├── .gitignore ├── icons └── bookmark.png ├── _locales ├── tr │ └── messages.json ├── zh_Hans │ └── messages.json ├── nl │ └── messages.json ├── en │ └── messages.json ├── pl │ └── messages.json └── de │ └── messages.json ├── .gitea └── issue_template │ ├── fr_template.yaml │ └── bug_template.yaml ├── scripts ├── popup.html ├── popup.min.js ├── options.html ├── popup.js ├── popup.min.css ├── options.min.css ├── popup.css ├── options.css ├── options.min.js ├── background.min.js └── options.js ├── manifest.json ├── README.md ├── CHANGELOG.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .web-extension-id 2 | web-ext-artifacts/ 3 | *.asc 4 | -------------------------------------------------------------------------------- /icons/bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Offerel/SyncMarks-Extension/HEAD/icons/bookmark.png -------------------------------------------------------------------------------- /_locales/tr/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensionName": { 3 | "message": "SyncMarks" 4 | }, 5 | "extensionDescription": { 6 | "message": "Yer işaretlerini ve sekmeleri kendi kendine barındırılan bir sunucu ile eşlemek için bu uzantıyı kullanın." 7 | }, 8 | "optionsServerURL": { 9 | "message": "Sunucu Adresi" 10 | }, 11 | "optionsUsername": { 12 | "message": "Kullanıcı adı" 13 | }, 14 | "optionsPassword": { 15 | "message": "Parola" 16 | }, 17 | "optionsSyncOptions": { 18 | "message": "Seçenekler" 19 | }, 20 | "optionsBTNImport": { 21 | "message": "İndir" 22 | }, 23 | "optionsBTNSettingsHint": { 24 | "message": "Yedekleme ayarları" 25 | }, 26 | "optionsBTNExport": { 27 | "message": "Yükle" 28 | }, 29 | "optionsBTNSave": { 30 | "message": "Kaydet" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.gitea/issue_template/fr_template.yaml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | about: File a feature request 3 | title: '[FR]: ' 4 | body: 5 | - type: input 6 | id: version 7 | attributes: 8 | label: Current version 9 | description: Whats the current version of the plugin where you are missing this feature? 10 | placeholder: ex. v1.5.7 11 | validations: 12 | required: true 13 | - type: textarea 14 | id: feature-description 15 | attributes: 16 | label: What? 17 | description: Please describe in detail, what you want to have as feature 18 | placeholder: '' 19 | value: '' 20 | validations: 21 | required: true 22 | - type: textarea 23 | id: why 24 | attributes: 25 | label: Why? 26 | description: What is not possible, if this feature will not be added? 27 | validations: 28 | required: true 29 | - type: textarea 30 | id: workaround 31 | attributes: 32 | label: Workaround 33 | description: If you think there is a workaround, please let me know. 34 | validations: 35 | required: true -------------------------------------------------------------------------------- /.gitea/issue_template/bug_template.yaml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | about: File a bug report 3 | title: '[Bug]: ' 4 | body: 5 | - type: textarea 6 | id: bug-description 7 | attributes: 8 | label: Description 9 | description: Please describe in detail, whats the problem 10 | placeholder: '' 11 | value: '' 12 | validations: 13 | required: true 14 | - type: input 15 | id: version 16 | attributes: 17 | label: Version 18 | description: What version of the plugin you find the issue? 19 | placeholder: ex. v1.5.7 20 | validations: 21 | required: true 22 | - type: dropdown 23 | id: browsers 24 | attributes: 25 | label: What browsers are you seeing the problem on? 26 | value: '' 27 | multiple: true 28 | options: 29 | - Firefox 30 | - Chrome 31 | - Chromium 32 | - Safari 33 | - Microsoft Edge 34 | - type: textarea 35 | id: browser-logs 36 | attributes: 37 | label: Log from the Browser Dev Console 38 | description: Please copy and paste the out put of errors from the Dev Console. This will be automatically formatted into code. 39 | render: shell 40 | validations: 41 | required: true -------------------------------------------------------------------------------- /scripts/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 | 12 | 13 | 16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 |
26 |
27 |
28 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "__MSG_extensionName__", 3 | "description": "__MSG_extensionDescription__", 4 | "homepage_url": "https://codeberg.org/Offerel/SyncMarks-Extension", 5 | "version": "2.1.13", 6 | "author": "Offerel", 7 | "manifest_version": 3, 8 | "default_locale": "en", 9 | "background": { 10 | "service_worker": "scripts/background.min.js", 11 | "scripts": ["scripts/background.min.js"], 12 | "type": "module" 13 | }, 14 | "browser_specific_settings": { 15 | "gecko": { 16 | "id": "davmarks@example.org", 17 | "strict_min_version": "128.0" 18 | }, 19 | "gecko_android": { 20 | "strict_min_version": "128.0" 21 | } 22 | }, 23 | "action": { 24 | "default_title": "__MSG_extensionName__", 25 | "default_popup": "scripts/popup.html" 26 | }, 27 | "commands": { 28 | "bookmark-tab": { 29 | "description": "__MSG_bookmarkTab__", 30 | "suggested_key": { 31 | "default": "Ctrl+Q" 32 | } 33 | } 34 | }, 35 | "icons": { 36 | "48": "icons/bookmark.png" 37 | }, 38 | "options_ui": { 39 | "open_in_tab": true, 40 | "page": "scripts/options.html" 41 | }, 42 | "permissions": [ 43 | "bookmarks", 44 | "storage", 45 | "notifications", 46 | "contextMenus", 47 | "tabs" 48 | ], 49 | "optional_host_permissions": [ 50 | "https://*/*" 51 | ], 52 | "web_accessible_resources": [ 53 | { 54 | "resources": [ 55 | "icons/bookmark.png" 56 | ], 57 | "matches": [ 58 | "*://*/*" 59 | ] 60 | } 61 | ] 62 | } 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SyncMarks Extension 2 | [![Translation status](https://translate.codeberg.org/widget/syncmarks/browser-extension/svg-badge.svg)](https://translate.codeberg.org/engage/syncmarks/) [![Issues](https://img.shields.io/gitea/issues/open/Offerel/SyncMarks-Extension?gitea_url=https%3A%2F%2Fcodeberg.org%2F)](https://codeberg.org/Offerel/SyncMarks-Extension/issues) ![License](https://img.shields.io/github/license/Offerel/SyncMarks-Extension) [![Version](https://img.shields.io/amo/v/davmarks%40example.org?label=version)](https://codeberg.org/Offerel/SyncMarks-Extension/releases/latest) 3 | This is a Webextension for Browsers to sync and backup your bookmarks via the SyncMarks Backend. You can simply install the AddOn for Firefox via [AMO](https://addons.mozilla.org/firefox/addon/syncmarks/) or for Microsoft Edge via [Edge Store](https://microsoftedge.microsoft.com/addons/detail/ffobakhdlfhmnnkmimkbnbmnplihhphg). The Addon will work also on other Chromium derivates, including [Kiwi Browser](https://play.google.com/store/apps/details?id=com.kiwibrowser.browser). You can use this plugin to export, import and sync your bookmarks to your backend. 4 | 5 | Currently there is no bookmark API for Firefox on Android available, but most other features should work there. The AddOn can be installed and work with alls features in Kiwi Browser. 6 | 7 | The bookmarks can be synced manually or automatically. There are corresponding options in the addon settings. The sync process is compatible with Browser internal Sync. 8 | 9 | ## Contribution 10 | ### Finding issues 11 | If you want to help, there are several things you can do for me. If you find a bug, please use the [issue tracker](https://codeberg.org/Offerel/SyncMarks-Extension/issues) and create a report so that I can fix it. Github.com is only a mirror for compatibility reason. 12 | 13 | ### Translate 14 | You can also contribute to the translation. This is very easy to do via Weblate. Some languages are already predefined, but you can add more languages at any time. 15 | [![Translation status](https://translate.codeberg.org/widget/syncmarks/browser-extension/multi-auto.svg)](https://translate.codeberg.org/engage/syncmarks/) 16 | 17 | 18 | ## Used Permissions 19 | There are some permissions needed for the Extension, to work properly. 20 | 21 | ### Read and modify bookmarks 22 | Since you export and import all your bookmarks, the AddOn needs access to them. Currently this API is supported on the desktop and on Kiwi on mobile. If the Mozilla implements this finally on mobile, it will work there to. 23 | 24 | ### Storage 25 | This is to save the AddOn options. 26 | 27 | ### Notifications 28 | The AddOn uses notifications to alert you about error occured or to notify you about pushes send from other clients. 29 | 30 | ### Context menus 31 | On desktop you can right click on a empty space at the page or on a link and can push this link as notification to other clients, including the Webapp. Since this API is not available on mobile, you can't use this feature there. On mobile you can use the toolbar button to send a page as notification. 32 | 33 | ## Current open issues 34 | There are some open browser issue, where i must use a workaround or if no workaround is possible, we have to wait for a upstream fix in Fennec/Chromium. This is a list of a issues im aware as of now: 35 | - Bookmark API isn't supported on Android. There is hope, that this will be supported in the upcoming future, but currently it's unsupported at least on Android. In Kiwi Browser its working as expected. You can follow the Firefox bug at https://bugzilla.mozilla.org/show_bug.cgi?id=1625231. As some sort of workaround, the Addon displays the bookmarks from the WebApp in the popup page, when you click on the AddOn button. 36 | - Context menu isn't supported on Firefox Android. The only workaround so far is to use the toolbar button. 37 | - Clicking the notification is not working on Android. The bug for this is now open since months. You can follow at https://github.com/mozilla-mobile/android-components/issues/7477 38 | - The settings page will not opened correctly in Firefox Android. The settings page will be opened invisible in a tab in the background, some other times it will opened multiple times. You can follow the bugreport at https://github.com/mozilla-mobile/fenix/issues/15742 39 | -------------------------------------------------------------------------------- /scripts/popup.min.js: -------------------------------------------------------------------------------- 1 | function keypress(e){46===e.keyCode&&bmIDs.length>0&&showBox()}function cbtn(e){"cyes"===e.target.id&&(chrome.runtime.sendMessage({action:"bmRemove",data:bmIDs}),chrome.runtime.sendMessage({action:"puData"})),document.getElementById("bglayer").style.display="none",bmIDs=[],window.close()}function showBox(){document.getElementById("msgText").innerText=chrome.i18n.getMessage("optionsPuDelConfirm"),document.getElementById("bglayer").style.display="block"}function cSearch(){let e=document.getElementById("bookmarks");for(;e.firstChild;)e.removeChild(e.firstChild);for(;clone.firstChild;)e.appendChild(clone.firstChild);clone=e.cloneNode(!0)}function addClick(){document.querySelectorAll(".file").forEach(function(e){return e.addEventListener("mouseup",function(e){0===e.button?e.ctrlKey?chrome.tabs.create({url:e.target.dataset.url,active:!1}):chrome.tabs.create({url:e.target.dataset.url,active:!0}):e.ctrlKey&&(e.target.classList.contains("bmMarked")?(e.target.classList.remove("bmMarked"),-1!==bmIDs.indexOf(e.target.id)&&bmIDs.splice(bmIDs.indexOf(e.target.id),1)):(e.target.classList.add("bmMarked"),bmIDs.push(e.target.id)))},!1),!1})}function urlExists(){chrome.tabs.query({active:!0,currentWindow:!0},function(e){let t=e[0].url,o=!1,n=document.querySelectorAll(".file"),r=document.getElementById("addbm").children[0];for(let e=0;e{let t=e.headers.get("X-Request-Info");return null!=t&&chrome.storage.local.set({token:t}),e.text()}).then(e=>{let t=new DOMParser,o=t.parseFromString(e,"text/html"),n=document.getElementById("bookmarks");for(clone=o.getElementById("bookmarks").cloneNode(!0);clone.firstChild;)n.appendChild(clone.firstChild);addClick(),urlExists(),clone=document.getElementById("bookmarks").cloneNode(!0),chrome.storage.session.set({bmhtml:e}),document.getElementById("loader").classList.remove("loader")}).catch(e=>{console.error(e),chrome.runtime.sendMessage({action:"changeIcon",data:"error"}),document.getElementById("loader").classList.remove("loader")});else{chrome.runtime.sendMessage({action:"loglines",data:"Bookmarks found in session"});let e=new DOMParser,t=e.parseFromString(o.bmhtml,"text/html"),n=document.getElementById("bookmarks");for(clone=t.getElementById("bookmarks").cloneNode(!0);clone.firstChild;)n.appendChild(clone.firstChild);addClick(),urlExists(),clone=document.getElementById("bookmarks").cloneNode(!0),document.getElementById("loader").classList.remove("loader")}}),document.getElementById("settings").addEventListener("click",function(){chrome.runtime.openOptionsPage(),window.close()}),document.getElementById("addbm").addEventListener("click",addBookmark),document.getElementById("cyes").addEventListener("click",cbtn),document.getElementById("cno").addEventListener("click",cbtn),chrome.storage.session.get(null,function(e){void 0!==e.popup&&(popupMessage(e.popup.message,e.popup.mode),chrome.action.setBadgeText({text:""}))}),document.getElementById("search").addEventListener("input",function(e){let t=e.currentTarget.value,o=document.querySelectorAll("#bookmarks li.file"),n=document.getElementById("bookmarks");if(""===e.currentTarget.value)cSearch(),addClick();else{for(;n.firstChild;)n.removeChild(n.firstChild);o.forEach(e=>{n.appendChild(e),e.innerText.toUpperCase().includes(t.toUpperCase())||e.firstChild.dataset.url.toUpperCase().includes(t.toUpperCase())?(e.style.display="block",e.style.paddingLeft="20px"):e.style.display="none"})}}),document.addEventListener("keyup",keypress),document.addEventListener("contextmenu",function(e){e.preventDefault()}); -------------------------------------------------------------------------------- /_locales/zh_Hans/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "infoEmptyConfig": { 3 | "message": "配置为空,请在使用前配置插件。" 4 | }, 5 | "optionsBTNCancel": { 6 | "message": "取消" 7 | }, 8 | "optionsBeforeLogin": { 9 | "message": "请使用您的凭据登录以接收访问您的书签" 10 | }, 11 | "optionsBTNImportHint": { 12 | "message": "从服务器恢复,覆盖本地书签。" 13 | }, 14 | "optionsErrorUser": { 15 | "message": "登录失败:请检查用户名和密码。" 16 | }, 17 | "optionsBeforeExport": { 18 | "message": "导出前,服务器上的所有书签都会删除。之后,新书签会导出到服务器。\n\n导出前是否应删除远程书签?" 19 | }, 20 | "optionsRestoreServer": { 21 | "message": "可从服务器恢复以下客户端。请从列表中选择一个客户端,或单击“取消”以不使用任何这些客户端。" 22 | }, 23 | "extensionName": { 24 | "message": "SyncMarks" 25 | }, 26 | "extensionDescription": { 27 | "message": "使用此扩展可将书签和标签页与自托管服务器同步。" 28 | }, 29 | "optionsServerURL": { 30 | "message": "服务器 URL" 31 | }, 32 | "optionsUsername": { 33 | "message": "用户名" 34 | }, 35 | "optionsPassword": { 36 | "message": "密码" 37 | }, 38 | "optionsSyncOptions": { 39 | "message": "选项" 40 | }, 41 | "optionsAuto": { 42 | "message": "自动同步" 43 | }, 44 | "optionsBTNImport": { 45 | "message": "下载" 46 | }, 47 | "optionsBTNSettingsHint": { 48 | "message": "备份设置" 49 | }, 50 | "optionsBTNExport": { 51 | "message": "上传" 52 | }, 53 | "optionsBTNExportHint": { 54 | "message": "覆盖服务器上的所有书签。" 55 | }, 56 | "optionsBTNSave": { 57 | "message": "保存" 58 | }, 59 | "optionsBTNSettings": { 60 | "message": "设置" 61 | }, 62 | "optionsBTNRestore": { 63 | "message": "恢复" 64 | }, 65 | "optionsBTNClear": { 66 | "message": "删除" 67 | }, 68 | "optionsDebugLog": { 69 | "message": "调试日志" 70 | }, 71 | "optionsBTNYes": { 72 | "message": "是" 73 | }, 74 | "optionsBTNNo": { 75 | "message": "否" 76 | }, 77 | "optionsNotUsed": { 78 | "message": "您现在可以从服务器同步书签。" 79 | }, 80 | "optionsSuccessSave": { 81 | "message": "选项已保存。" 82 | }, 83 | "optionsErrorLogin": { 84 | "message": "登录失败, 状态: " 85 | }, 86 | "optionsBeforeCImpExp": { 87 | "message": "您可以在此处从服务器恢复现有的客户端设置。" 88 | }, 89 | "optionsWrongAData": { 90 | "message": "登录错误。请重新登录" 91 | }, 92 | "infoRestoreID": { 93 | "message": "是否应从服务器中移除旧客户端以避免同步问题?" 94 | }, 95 | "optionsSuccessImport": { 96 | "message": "导入成功。" 97 | }, 98 | "optionsBeforeImport": { 99 | "message": "导入前是否应删除所有本地书签?" 100 | }, 101 | "optionsInfoRemove": { 102 | "message": "如果继续,将会移除所有当前书签。\n\n是否确定要删除所有本地书签?" 103 | }, 104 | "popupBTNOptions": { 105 | "message": "选项" 106 | }, 107 | "errorGetBookmarks": { 108 | "message": "从服务器检索书签时出错。状态响应为: " 109 | }, 110 | "errorSaveBookmarks": { 111 | "message": "保存所有书签时出错。状态响应为: " 112 | }, 113 | "errorExportBookmarks": { 114 | "message": "导出书签时出现问题。" 115 | }, 116 | "successExportBookmarks": { 117 | "message": "本地书签已成功添加到服务器。" 118 | }, 119 | "successImportBookmarks": { 120 | "message": " 书签/文件夹已导入。" 121 | }, 122 | "infoNewClient": { 123 | "message": "此浏览器是新客户端,现已在服务器上注册。" 124 | }, 125 | "sendPage": { 126 | "message": "发送页面" 127 | }, 128 | "sendTab": { 129 | "message": "发送标签页" 130 | }, 131 | "sendLink": { 132 | "message": "发送链接" 133 | }, 134 | "sendLinkNot": { 135 | "message": "无法发送链接。" 136 | }, 137 | "sendLinkYes": { 138 | "message": "链接发送成功。" 139 | }, 140 | "bookmarkTab": { 141 | "message": "直接添加书签到服务器" 142 | }, 143 | "ManAuto": { 144 | "message": "激活自动同步" 145 | }, 146 | "toBackend": { 147 | "message": "手动将书签直接发送到服务器" 148 | }, 149 | "optionsLogfile": { 150 | "message": "日志文件" 151 | }, 152 | "optionsChangelog": { 153 | "message": "更新日志" 154 | }, 155 | "optionsLastLogged": { 156 | "message": "最后登录的是" 157 | }, 158 | "optionsLogin": { 159 | "message": "登录" 160 | }, 161 | "optionsClientName": { 162 | "message": "客户端名称" 163 | }, 164 | "optionsTabs": { 165 | "message": "标签页" 166 | }, 167 | "optionsTabsHint": { 168 | "message": "在客户端之间同步打开的标签页" 169 | }, 170 | "optionsLegendServer": { 171 | "message": "服务器" 172 | }, 173 | "optionsLegendBookmarks": { 174 | "message": "书签" 175 | }, 176 | "optionsBTNBackup": { 177 | "message": "备份" 178 | }, 179 | "optionsBAPIHint": { 180 | "message": "此浏览器不支持书签 API。因此,自动同步功能已停用。" 181 | }, 182 | "optionsPuDelConfirm": { 183 | "message": "是否应移除所选书签?" 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /_locales/nl/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensionDescription": { 3 | "message": "Met behulp van deze extensie kunt u uw bladwijzers en tabbladen synchroniseren naar uw eigen server." 4 | }, 5 | "infoRestoreID": { 6 | "message": "Dient de oude client verwijderd te worden om synchronisatieproblemen te voorkomen?" 7 | }, 8 | "optionsErrorUser": { 9 | "message": "Het inloggen is mislukt: controleer uw gebruikersnaam en wachtwoord." 10 | }, 11 | "optionsBeforeExport": { 12 | "message": "Alle bladwijzers op de server worden voorafgaand aan het exporteren verwijderd. Nadien kunnen de nieuwe worden geëxporteerd naar de server.\n\nWeet u zeker dat u alle serverbladwijzers wilt verwijderen?" 13 | }, 14 | "optionsDebugLog": { 15 | "message": "Foutopsporingslogboek" 16 | }, 17 | "extensionName": { 18 | "message": "SyncMarks" 19 | }, 20 | "optionsServerURL": { 21 | "message": "Server-url" 22 | }, 23 | "optionsUsername": { 24 | "message": "Gebruikersnaam" 25 | }, 26 | "optionsPassword": { 27 | "message": "Wachtwoord" 28 | }, 29 | "optionsSyncOptions": { 30 | "message": "Instellingen" 31 | }, 32 | "optionsAuto": { 33 | "message": "Automatisch synchroniseren" 34 | }, 35 | "optionsBTNImport": { 36 | "message": "Downloaden" 37 | }, 38 | "optionsBTNImportHint": { 39 | "message": "Herstel vanaf de server en overschrijf lokale bladwijzers." 40 | }, 41 | "optionsBTNSettingsHint": { 42 | "message": "Reservekopie-instellingen" 43 | }, 44 | "optionsBTNExport": { 45 | "message": "Uploaden" 46 | }, 47 | "optionsBTNExportHint": { 48 | "message": "Overschrijf alle bladwijzers op de server." 49 | }, 50 | "optionsBTNSave": { 51 | "message": "Opslaan" 52 | }, 53 | "optionsBTNSettings": { 54 | "message": "Instellingen" 55 | }, 56 | "optionsBTNRestore": { 57 | "message": "Herstellen" 58 | }, 59 | "optionsBTNClear": { 60 | "message": "Verwijderen" 61 | }, 62 | "optionsBTNYes": { 63 | "message": "Ja" 64 | }, 65 | "optionsBTNNo": { 66 | "message": "Nee" 67 | }, 68 | "optionsBTNCancel": { 69 | "message": "Annuleren" 70 | }, 71 | "optionsNotUsed": { 72 | "message": "De bladwijzersynchronisatie kan beginnen." 73 | }, 74 | "optionsSuccessSave": { 75 | "message": "De instellingen zijn opgeslagen." 76 | }, 77 | "optionsErrorLogin": { 78 | "message": "Het inloggen is mislukt - status: " 79 | }, 80 | "optionsBeforeCImpExp": { 81 | "message": "Hier kunt u de clientinstellingen herstellen vanaf de server." 82 | }, 83 | "optionsBeforeLogin": { 84 | "message": "Log in op uw account om toegang tot uw bladwijzers te verkrijgen" 85 | }, 86 | "optionsWrongAData": { 87 | "message": "Het inloggen is mislukt - probeer het opnieuw" 88 | }, 89 | "optionsSuccessImport": { 90 | "message": "Het importeren is voltooid." 91 | }, 92 | "optionsBeforeImport": { 93 | "message": "Dienen alle lokale bladwijzers voorafgaand aan het importeren verwijderd te worden?" 94 | }, 95 | "optionsInfoRemove": { 96 | "message": "Als u doorgaat, worden al uw huidige bladwijzers verwijderd.\n\nWeet u zeker dat u alle lokale bladwijzers wilt verwijderen?" 97 | }, 98 | "popupBTNOptions": { 99 | "message": "Instellingen" 100 | }, 101 | "errorGetBookmarks": { 102 | "message": "Er is een fout opgetreden tijdens het ophalen van de bladwijzers. Het statusantwoord is " 103 | }, 104 | "errorSaveBookmarks": { 105 | "message": "Er is een fout opgetreden tijdens het opslaan. Het statusantwoord is " 106 | }, 107 | "errorExportBookmarks": { 108 | "message": "Er is een probleem opgetreden tijdens het exporteren." 109 | }, 110 | "successExportBookmarks": { 111 | "message": "De lokale bladwijzers zijn geëxporteerd naar de server." 112 | }, 113 | "successImportBookmarks": { 114 | "message": " bladwijzers/mappen geïmporteerd." 115 | }, 116 | "infoNewClient": { 117 | "message": "Deze browser is nieuw en daarom geregistreerd op de server." 118 | }, 119 | "infoEmptyConfig": { 120 | "message": "Er zijn geen instellingen. Stel de extensie in alvorens deze te gebruiken." 121 | }, 122 | "sendPage": { 123 | "message": "Pagina versturen" 124 | }, 125 | "sendTab": { 126 | "message": "Tabblad versturen" 127 | }, 128 | "sendLink": { 129 | "message": "Link versturen" 130 | }, 131 | "sendLinkNot": { 132 | "message": "De link kan niet worden verstuurd." 133 | }, 134 | "sendLinkYes": { 135 | "message": "De link is verstuurd." 136 | }, 137 | "bookmarkTab": { 138 | "message": "Bladwijzer naar server versturen" 139 | }, 140 | "ManAuto": { 141 | "message": "Automatische synchronisatie inschakelen" 142 | }, 143 | "toBackend": { 144 | "message": "Bladwijzer direct naar server versturen" 145 | }, 146 | "optionsLastLogged": { 147 | "message": "Laatst ingelogd met" 148 | }, 149 | "optionsRestoreServer": { 150 | "message": "De volgende clients kunnen worden hersteld vanaf de server. Kies een client uit de lijst of klik op annuleren om geen van de clients te kiezen." 151 | }, 152 | "optionsLogfile": { 153 | "message": "Logboek" 154 | }, 155 | "optionsChangelog": { 156 | "message": "Wijzigingslog" 157 | }, 158 | "optionsLogin": { 159 | "message": "Inloggen" 160 | }, 161 | "optionsClientName": { 162 | "message": "Clientnaam" 163 | }, 164 | "optionsTabs": { 165 | "message": "Tabbladen" 166 | }, 167 | "optionsTabsHint": { 168 | "message": "Geopende tabbladen synchroniseren tussen clients" 169 | }, 170 | "optionsLegendServer": { 171 | "message": "Server" 172 | }, 173 | "optionsLegendBookmarks": { 174 | "message": "Bladwijzers" 175 | }, 176 | "optionsBTNBackup": { 177 | "message": "Reservekopie" 178 | }, 179 | "optionsBAPIHint": { 180 | "message": "De Bookmark API wordt niet ondersteund in deze browser. Automatische synchronisatie is daarom uitgeschakeld." 181 | }, 182 | "optionsPuDelConfirm": { 183 | "message": "Wil je de gekozen bladwijzers verwijderen?" 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /scripts/options.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | SyncMarks - Options 9 | 10 | 11 |
12 |

SyncMarks__MSG_extensionName__

13 | 14 | 15 | 16 |
17 |
18 |
19 |
20 | __MSG_optionsLegendServer__ 21 | __MSG_optionsWrongAData__ 22 |
23 |
24 |
25 |
26 | __MSG_optionsSyncOptions__ 27 |
28 |
29 |
30 |
31 |
32 | __MSG_optionsLegendBookmarks__ 33 |
34 | 35 |
36 |
37 | 38 |
39 |
40 |
41 | __MSG_optionsBTNSettings__ 42 |
43 |
44 |
45 |
46 | 59 | 67 | 77 | 85 | 93 | 101 |
102 |
103 | 112 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /scripts/popup.js: -------------------------------------------------------------------------------- 1 | var clone; 2 | var bmIDs = new Array(); 3 | 4 | chrome.storage.local.get(null, async function(options) { 5 | document.getElementById('loader').classList.add('loader'); 6 | let authheader = 'Bearer ' + btoa(encodeURIComponent(JSON.stringify({ 7 | client:options.uuid, 8 | token:options.token 9 | }))); 10 | 11 | const data = await chrome.storage.session.get("bmhtml"); 12 | 13 | if(data.bmhtml === undefined) { 14 | chrome.runtime.sendMessage({action: "loglines", data: 'No bookmarks for PopUp found'}); 15 | fetch(options.instance + '?t=' + Math.random().toString(24).substring(2, 12), { 16 | method: "GET", 17 | cache: "no-cache", 18 | referrerPolicy: "no-referrer", 19 | headers: { 20 | 'Authorization': authheader, 21 | } 22 | }).then(response => { 23 | let xRinfo = response.headers.get("X-Request-Info"); 24 | if (xRinfo != null) { 25 | chrome.storage.local.set({token:xRinfo}); 26 | } 27 | return response.text(); 28 | }).then(html => { 29 | let parser = new DOMParser(); 30 | let doc = parser.parseFromString(html, "text/html"); 31 | let bookmarks = document.getElementById('bookmarks'); 32 | clone = doc.getElementById('bookmarks').cloneNode(true); 33 | while(clone.firstChild) bookmarks.appendChild(clone.firstChild); 34 | addClick(); 35 | urlExists(); 36 | clone = document.getElementById('bookmarks').cloneNode(true); 37 | chrome.storage.session.set({bmhtml: html}); 38 | document.getElementById('loader').classList.remove('loader'); 39 | }).catch(err => { 40 | console.error(err); 41 | chrome.runtime.sendMessage({action: "changeIcon", data: 'error'}); 42 | document.getElementById('loader').classList.remove('loader'); 43 | }); 44 | } else { 45 | chrome.runtime.sendMessage({action: "loglines", data: 'Bookmarks found in session'}); 46 | let parser = new DOMParser(); 47 | let doc = parser.parseFromString(data.bmhtml, "text/html"); 48 | let bookmarks = document.getElementById('bookmarks'); 49 | clone = doc.getElementById('bookmarks').cloneNode(true); 50 | while(clone.firstChild) bookmarks.appendChild(clone.firstChild); 51 | addClick(); 52 | urlExists(); 53 | clone = document.getElementById('bookmarks').cloneNode(true); 54 | document.getElementById('loader').classList.remove('loader'); 55 | } 56 | }); 57 | 58 | document.getElementById("settings").addEventListener('click', function() { 59 | chrome.runtime.openOptionsPage(); 60 | window.close(); 61 | }); 62 | 63 | document.getElementById("addbm").addEventListener('click', addBookmark); 64 | 65 | document.getElementById('cyes').addEventListener('click', cbtn); 66 | document.getElementById('cno').addEventListener('click', cbtn); 67 | 68 | chrome.storage.session.get(null, function(data) { 69 | if(data.popup !== undefined) { 70 | popupMessage(data.popup.message, data.popup.mode); 71 | chrome.action.setBadgeText({text: ''}); 72 | } 73 | }); 74 | 75 | document.getElementById("search").addEventListener('input', function(e) { 76 | let filter = e.currentTarget.value; 77 | let bookmarks = document.querySelectorAll('#bookmarks li.file'); 78 | let bdiv = document.getElementById('bookmarks'); 79 | 80 | if(e.currentTarget.value === ''){ 81 | cSearch(); 82 | addClick(); 83 | } else { 84 | while(bdiv.firstChild) bdiv.removeChild(bdiv.firstChild); 85 | bookmarks.forEach(bookmark => { 86 | bdiv.appendChild(bookmark); 87 | if(bookmark.innerText.toUpperCase().includes(filter.toUpperCase()) || bookmark.firstChild.dataset.url.toUpperCase().includes(filter.toUpperCase())) { 88 | bookmark.style.display = 'block'; 89 | bookmark.style.paddingLeft = '20px'; 90 | } else { 91 | bookmark.style.display = 'none'; 92 | } 93 | }); 94 | } 95 | }); 96 | 97 | document.addEventListener('keyup', keypress); 98 | 99 | document.addEventListener('contextmenu', function(e) { 100 | e.preventDefault(); 101 | }); 102 | 103 | function keypress(e) { 104 | if(e.keyCode === 46 && bmIDs.length > 0) showBox(); 105 | } 106 | 107 | function cbtn(e) { 108 | if(e.target.id === 'cyes') { 109 | chrome.runtime.sendMessage({action: "bmRemove", data: bmIDs}); 110 | chrome.runtime.sendMessage({action: "puData"}); 111 | } 112 | 113 | document.getElementById('bglayer').style.display = 'none'; 114 | bmIDs = []; 115 | window.close(); 116 | } 117 | 118 | function showBox() { 119 | document.getElementById('msgText').innerText = chrome.i18n.getMessage("optionsPuDelConfirm"); 120 | document.getElementById('bglayer').style.display = 'block'; 121 | } 122 | 123 | function cSearch() { 124 | let bookmarks = document.getElementById('bookmarks'); 125 | while(bookmarks.firstChild) bookmarks.removeChild(bookmarks.firstChild); 126 | while(clone.firstChild) bookmarks.appendChild(clone.firstChild); 127 | clone = bookmarks.cloneNode(true); 128 | } 129 | 130 | function addClick() { 131 | document.querySelectorAll('.file').forEach(function(bookmark){ 132 | bookmark.addEventListener('mouseup', function(e) { 133 | if(e.button === 0) { 134 | if(!e.ctrlKey) { 135 | chrome.tabs.create({url: e.target.dataset.url, active: true}); 136 | } else { 137 | chrome.tabs.create({url: e.target.dataset.url, active: false}); 138 | } 139 | } else { 140 | 141 | if(e.ctrlKey) { 142 | if(e.target.classList.contains('bmMarked')) { 143 | e.target.classList.remove('bmMarked'); 144 | bmIDs.indexOf(e.target.id) !== -1 && bmIDs.splice(bmIDs.indexOf(e.target.id), 1) 145 | } else { 146 | e.target.classList.add('bmMarked'); 147 | bmIDs.push(e.target.id); 148 | } 149 | } 150 | } 151 | }, false); 152 | return false; 153 | }); 154 | } 155 | 156 | function urlExists() { 157 | chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { 158 | let tabURL = tabs[0].url; 159 | let urlExists = false; 160 | let bookmarks = document.querySelectorAll('.file'); 161 | let tbutton = document.getElementById('addbm').children[0]; 162 | 163 | for (let i = 0; i < bookmarks.length; i++) { 164 | bmURL = bookmarks[i].children[0].dataset.url; 165 | if(tabURL === bmURL) { 166 | urlExists = true; 167 | break; 168 | } 169 | } 170 | 171 | tbutton.attributes.fill.nodeValue = (urlExists) ? "gold":"currentColor"; 172 | }); 173 | } 174 | 175 | function popupMessage(message, state) { 176 | let mdiv = document.getElementById('popupMessage'); 177 | mdiv.innerText = message; 178 | mdiv.className = 'show ' + state; 179 | setTimeout(function(){ 180 | mdiv.classList.remove('show'); 181 | chrome.storage.session.remove('popup'); 182 | chrome.action.setBadgeText({text: ''}); 183 | }, 3000); 184 | } 185 | 186 | function addBookmark() { 187 | chrome.storage.local.get(null, function(options) { 188 | chrome.permissions.getAll(function(e) { 189 | if(options.sync === false || e.permissions.includes('bookmarks') === false) { 190 | chrome.runtime.sendMessage({action: "bookmarkTab"}); 191 | window.close(); 192 | } else { 193 | chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { 194 | let createBookmark = chrome.bookmarks.create({ 195 | title: tabs[0].title, 196 | url: tabs[0].url, 197 | }, function(newE) { 198 | window.close(); 199 | }); 200 | }); 201 | } 202 | }); 203 | }); 204 | 205 | chrome.runtime.sendMessage({action: "puData"}); 206 | } -------------------------------------------------------------------------------- /scripts/popup.min.css: -------------------------------------------------------------------------------- 1 | html{margin:0;padding:0}body{border:0;margin:0;padding:0;height:490px;width:320px;font-size:100%}#svgfilled{display:none;color:gold}#toolbar{background-color:#0879d9;position:absolute;left:0;right:0;top:0;bottom:40px}#search{border:1px solid transparent;outline:0;line-height:2.5em;border-radius:20px;top:7px;position:absolute;right:3.5em;left:3.5em;padding:0 10px 0 25px;background-color:#0e62a9;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%230879d9' d='M416 208c0 45.9-14.9 88.3-40 122.7l126.6 126.7c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:15px;background-position:5px;color:#0e62a9}#search:hover{background-color:#96caf5}#search:focus{border:1px solid #00f!important;outline:0!important;background-color:#96caf5}#toolbar button{outline:0;top:.8em;position:absolute;background-color:transparent;cursor:pointer;margin:0;padding:0;border:0}#toolbar button:disabled{cursor:auto}button>svg{height:2em;color:#96caf5}button:not([disabled])>svg:hover{color:#e7f4ff}button:disabled>svg{color:#6495ed}#settings{left:10px}#addbm{right:10px}#bookmarks{background-color:#eef3fa;white-space:nowrap;overflow-x:hidden;overflow-y:auto;top:3em;bottom:0;position:absolute;width:100%;padding:5px 0;font-size:1em;font-family:Sans-serif}#bookmarks ol.tree{padding:0 0 0 20px;width:90%}#bookmarks>li.file{margin-left:29px!important}#bookmarks li{position:relative;margin:0 20px;list-style:none}#bookmarks li.file{margin-left:-2px!important}#bookmarks li.file span{background-size:16px;color:#000;padding-left:23px;text-decoration:none;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath fill='%23dff0fe' d='M39,20c0,10.578-8.618,19-19,19C9.619,39,1,30.578,1,20S9.422,1,20,1S39,9.422,39,20z'%3E%3C/path%3E%3Cpath fill='%2398ccfd' d='M27.124 26.951c.432.215.864.215 1.081.647.647.649.647 1.728.864 2.376.215.864.432 1.727.864 2.591.216 1.081.648 2.16.864 3.023.141-.11.306-.213.463-.318C35.927 31.822 39 26.302 39 20c0-5.597-2.373-10.575-6.161-14.037-.459-.151-.93-.165-1.396.042-.648.217-1.079 1.081-1.511 1.512-.432.648-.864 1.295-1.295 1.943-.217.216-.432.648-.217.864 0 .216.217.216.432.216.432.217.649.217 1.081.432.216 0 .432.217.216.432 0 0 0 .217-.216.217-1.081 1.08-2.159 1.943-3.239 3.022-.216.216-.432.648-.432.864 0 .216.216.216.216.432 0 .217-.216.217-.432.432-.432.217-.864.432-1.08.649-.216.432 0 1.08-.216 1.511-.216 1.079-.865 1.943-1.297 3.023-.432.647-.647 1.295-1.078 1.943 0 .864-.217 1.511.215 2.159C23.67 27.166 25.612 26.302 27.124 26.951zM26.725 2.21C24.638 1.432 22.375 1 20 1c-.391 0-.776.019-1.161.041-.27.419-.485.832-.566 1.078-.216 1.079.648.864 1.511 1.079 0 0 .216 1.727.216 1.943.216 1.081-.432 1.727-.432 2.807 0 .648 0 1.727.432 2.159h.216c.216 0 .432-.216.864-.432.648-.432 1.296-1.079 1.943-1.511.649-.432 1.296-1.079 1.728-1.511.648-.432 1.079-1.295 1.295-1.944.216-.432.956-1.704.739-2.351C26.769 2.323 26.746 2.263 26.725 2.21zM1.432 20.902c.648 1.295 1.943 2.592 3.239 3.454.864.648 2.591.648 3.454 1.727.648.865.432 1.943.432 3.023 0 1.295.864 2.375 1.295 3.453.216.649.432 1.512.648 2.16 0 .216.216 1.511.216 1.727.069.035.126.114.177.212 1.153.632 2.378 1.14 3.657 1.524.016.001.037-.012.053-.008.216 0 1.08-1.296 1.08-1.512.648-.648 1.079-1.511 1.727-1.943.432-.216.864-.432 1.295-.865.432-.432.648-1.295.864-1.943.216-.431.432-1.294.216-1.942-.137-.41-.216-.648-.648-.864-1.295-.432-2.591-.432-3.67-1.512-.216-.432-.216-.864-.432-1.295-.432-.432-1.511-.648-2.159-.864h-2.807H8.557c-.648-.216-1.079-1.08-1.511-1.727 0-.216 0-.649-.432-.649-.432-.215-.864.217-1.295 0-.216-.215-.216-.432-.216-.647 0-.649.432-1.296.864-1.728C6.614 20.253 7.262 20.9 7.909 20.9c.216 0 .216 0 .432.216.648.216.864 1.079.864 1.728v.432c0 .216.216.216.432.216.216-1.079.216-2.16.432-3.239 0-1.295 1.295-2.592 2.375-3.023.432-.215.648.217 1.079 0 1.295-.432 4.534-1.727 3.886-3.453-.432-1.512-1.727-3.022-3.454-2.807-.432.217-.648.432-1.079.649-.648.432-1.943 1.727-2.591 1.727-1.079-.216-1.079-1.727-.864-2.376.216-.864 2.159-3.669 3.454-3.238.216.216.648.648.864.864.432.216 1.08.216 1.727.216.216 0 .432 0 .648-.216.216-.216.216-.216.216-.432 0-.648-.648-1.296-1.079-1.728-.432-.432-1.08-.864-1.727-1.078-1.38-.415-4.295.076-6.672.878C3.24 9.685 1 14.553 1 20c0 .091.009.18.01.271C1.164 20.489 1.312 20.702 1.432 20.902z'%3E%3C/path%3E%3Cpath fill='%234788c7' d='M20,2c10.093,0,18,7.907,18,18c0,9.925-8.075,18-18,18S2,29.925,2,20C2,9.907,9.907,2,20,2 M20,1 C9.422,1,1,9.422,1,20s8.619,19,19,19c10.382,0,19-8.422,19-19S30.578,1,20,1L20,1z'%3E%3C/path%3E%3C/svg%3E");background-repeat:no-repeat;background-position:0;-webkit-touch-callout:none!important;-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;-o-user-select:none!important;user-select:none!important;max-width:fit-content;cursor:pointer}#bookmarks li input{position:absolute;left:0;margin-left:0;opacity:0;z-index:2;cursor:pointer;height:1em;width:1em;top:0}#bookmarks li input+ol{background:0 0;background-size:13px;background-position:38px -2px;margin:-.938em 0 0 -44px;height:1em;text-overflow:ellipsis}#bookmarks li input+ol>li{display:none;padding-left:1px}#bookmarks li label{cursor:pointer;display:block;font-size:1em;line-height:1.6em;text-overflow:ellipsis;overflow:hidden;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath fill='%23dbb065' d='M2.5 71.5L2.5 8.5 23.793 8.5 29.793 14.5 77.5 14.5 77.5 71.5z'%3E%3C/path%3E%3Cpath fill='%23967a44' d='M23.586,9l5.707,5.707L29.586,15H30h47v56H3V9H23.586 M24,8H2v64h76V14H30L24,8L24,8z'%3E%3C/path%3E%3Cg%3E%3Cpath fill='%23f5ce85' d='M2.5 71.5L2.5 18.5 24.151 18.5 30.151 14.5 77.5 14.5 77.5 71.5z'%3E%3C/path%3E%3Cpath fill='%23967a44' d='M77,15v56H3V19h21h0.303l0.252-0.168L30.303,15H77 M78,14H30l-6,4H2v54h76V14L78,14z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat}#bookmarks :not(.mainFolder) label{position:unset;top:unset;width:max-content;z-index:unset;left:unset;background-color:unset;height:unset;border-bottom:unset;padding:0 5px 0 35px;margin-left:-5px;border-radius:3px;user-select:none;position:relative}#bookmarks :not(.mainFolder) ol{position:unset;top:unset;z-index:unset;margin-bottom:unset!important}#bookmarks li input:checked+ol{margin:-1.25em 0 0 -40px;padding:1.563em 0 0 65px;height:auto;background-position:38px 2px}#bookmarks li input:checked+ol>li{display:block;margin:0 0 .3em}#bookmarks li input:checked+ol>li:last-child{margin:0 0 .063em}#popupMessage{visibility:hidden;width:90%;background-color:transparent;box-shadow:rgba(0,0,0,.24) 0 3px 8px;color:#fff;text-align:center;border-radius:5px;padding:3px 6px;position:fixed;z-index:1;left:50%;bottom:40px;font-size:16px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;transform:translateX(-50%);transition:opacity 2s;opacity:0}#popupMessage.show{visibility:visible;opacity:1}#popupMessage.error{background-color:#f2dede;border-color:#eda6b2;color:#d8000c}#popupMessage.warn{background-color:#feefb3;color:#9f6000;border-color:#eea236}#popupMessage.success{background-color:#dff2bf;color:#270;border-color:#a2dfa2}#popupMessage.info{background-color:#bef;color:#059;border-color:#74d6f3}#loader{position:absolute;left:calc(50% - 25px);top:calc(50% - 25px);z-index:1}.loader{width:50px;aspect-ratio:1;display:grid;border:4px solid #0000;border-radius:50%;border-color:#ccc #0000;animation:l16 1s infinite linear}.loader::after,.loader::before{content:"";grid-area:1/1;margin:2px;border:inherit;border-radius:50%}.loader::before{border-color:#f03355 #0000;animation:inherit;animation-duration:.5s;animation-direction:reverse}.loader::after{margin:8px}@keyframes l16{100%{transform:rotate(1turn)}}.bmMarked{background-color:#00000073;padding:0 .51em;border-radius:.3em;color:#fff!important}#msgBox{width:90%;top:35%;position:sticky;height:100px;background:#fff;margin-left:auto;margin-right:auto;border-radius:10px;box-shadow:1px 5px 15px -8px rgba(51,51,51,.51)}#bglayer{width:100%;background-color:#0000003b;height:100%;position:absolute;display:none}#msgText{width:100%;height:55px;padding:5px 10px}#msgBtn{height:30px;position:absolute;width:100%;text-align:center}#msgBtn button{background-color:#2196f3;border:none;color:#fff;font-weight:501;padding:3px 10px;border-radius:4px;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);font-family:Roboto,"Segoe UI",BlinkMacSystemFont,system-ui;outline:0;cursor:pointer;margin:0 25px} -------------------------------------------------------------------------------- /_locales/en/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensionName": { 3 | "message": "SyncMarks", 4 | "description": "Name of the extension." 5 | }, 6 | "extensionDescription": { 7 | "message": "Use this extension to synchronize bookmarks and tabs with a self-hosted server.", 8 | "description": "Description for the extension" 9 | }, 10 | "optionsServerURL": { 11 | "message": "Server URL", 12 | "description": "URL to the backend" 13 | }, 14 | "optionsUsername": { 15 | "message": "Username", 16 | "description": "Username" 17 | }, 18 | "optionsPassword": { 19 | "message": "Password", 20 | "description": "Password" 21 | }, 22 | "optionsSyncOptions": { 23 | "message": "Options", 24 | "description": "Syncmark Options" 25 | }, 26 | "optionsAuto": { 27 | "message": "Automatic synchronization", 28 | "description": "Automatic synchronization" 29 | }, 30 | "optionsBTNImport": { 31 | "message": "Download", 32 | "description": "Download Bookmarks" 33 | }, 34 | "optionsBTNImportHint": { 35 | "message": "Restore from server, overwrite local bookmarks.", 36 | "description": "Import Button Hint" 37 | }, 38 | "optionsBTNSettingsHint": { 39 | "message": "Backup settings", 40 | "description": "Backup settings tooltip" 41 | }, 42 | "optionsBTNExport": { 43 | "message": "Upload", 44 | "description": "Upload Bookmarks" 45 | }, 46 | "optionsBTNExportHint": { 47 | "message": "Overwrite all bookmarks on the server.", 48 | "description": "Export Button Hint tooltip" 49 | }, 50 | "optionsBTNSave": { 51 | "message": "Save", 52 | "description": "Save Button" 53 | }, 54 | "optionsBTNSettings": { 55 | "message": "Settings", 56 | "description": "Settings button" 57 | }, 58 | "optionsBTNRestore": { 59 | "message": "Restore", 60 | "description": "Re-Store the settings" 61 | }, 62 | "optionsBTNClear": { 63 | "message": "Delete", 64 | "description": "Clear the logfile" 65 | }, 66 | "optionsDebugLog": { 67 | "message": "Debug Log", 68 | "description": "Show debug messages" 69 | }, 70 | "optionsBTNYes": { 71 | "message": "Yes", 72 | "description": "Yes Button" 73 | }, 74 | "optionsBTNNo": { 75 | "message": "No", 76 | "description": "No Button" 77 | }, 78 | "optionsBTNCancel": { 79 | "message": "Cancel", 80 | "description": "Cancel Button" 81 | }, 82 | "optionsNotUsed": { 83 | "message": "You can now synchronize bookmarks from the server.", 84 | "description": "Hint that you can now sync bookmarks" 85 | }, 86 | "optionsErrorUser": { 87 | "message": "Login failed: Please check username and password.", 88 | "description": "Login failed, wrong User" 89 | }, 90 | "optionsSuccessSave": { 91 | "message": "Options saved.", 92 | "description": "Login successfully" 93 | }, 94 | "optionsErrorLogin": { 95 | "message": "Login failed: Status: ", 96 | "description": "Login failed, unknown state" 97 | }, 98 | "optionsBeforeCImpExp": { 99 | "message": "Here you can restore your existing client settings from the server.", 100 | "description": "Description to store the settings" 101 | }, 102 | "optionsBeforeLogin": { 103 | "message": "Please log in with your credentials to receive an access your bookmarks", 104 | "description": "Hint before login" 105 | }, 106 | "optionsWrongAData": { 107 | "message": "Login error. Please log in again", 108 | "description": "Login error message" 109 | }, 110 | "infoRestoreID": { 111 | "message": "Should the old client be removed from the server to avoid synchronization problems?", 112 | "description": "Question if you want to remove old client id from the server" 113 | }, 114 | "optionsSuccessImport": { 115 | "message": "Import successfully.", 116 | "description": "Message on succesfull import" 117 | }, 118 | "optionsBeforeImport": { 119 | "message": "Should all local bookmarks be deleted before import?", 120 | "description": "Warning message before importing" 121 | }, 122 | "optionsBeforeExport": { 123 | "message": "All bookmarks are deleted at the server before exporting. Afterwards the new bookmarks are exported to the server.\n\nShould the remote bookmarks be deleted before the export?", 124 | "description": "Warning message that all remote bookmarks are deleted" 125 | }, 126 | "optionsInfoRemove": { 127 | "message": "When you continue, all your current bookmarks are removed.\n\nAre you sure to delete all local bookmarks?", 128 | "description": "Warning message, that all local bookmarks will be deleted" 129 | }, 130 | "popupBTNOptions": { 131 | "message": "Options", 132 | "description": "Options Button" 133 | }, 134 | "errorGetBookmarks": { 135 | "message": "There was a error retrieving the bookmarks from the server. The status response is: ", 136 | "description": "http error when retrieving bookmarks." 137 | }, 138 | "errorSaveBookmarks": { 139 | "message": "There was some error saving all bookmarks. The status response is: ", 140 | "description": "http error when saving bookmarks." 141 | }, 142 | "errorExportBookmarks": { 143 | "message": "There was a problem exporting the bookmarks.", 144 | "description": "Error when exporting bookmarks." 145 | }, 146 | "successExportBookmarks": { 147 | "message": "Local bookmarks successfully added at server.", 148 | "description": "All bookmarks exported." 149 | }, 150 | "successImportBookmarks": { 151 | "message": " bookmarks/folders imported.", 152 | "description": "Message with count bookmarks imported" 153 | }, 154 | "infoNewClient": { 155 | "message": "This browser is a new client and is now registered at the server.", 156 | "description": "New Client, unknown to the server." 157 | }, 158 | "infoEmptyConfig": { 159 | "message": "Configuration is empty. Please configure the AddOn before use.", 160 | "description": "Message if extension is not configured yet." 161 | }, 162 | "sendPage": { 163 | "message": "Send Page", 164 | "description": "Context Menu entry" 165 | }, 166 | "sendTab": { 167 | "message": "Send Tab", 168 | "description": "Context Menu entry" 169 | }, 170 | "sendLink": { 171 | "message": "Send Link", 172 | "description": "Context Menu entry" 173 | }, 174 | "sendLinkNot": { 175 | "message": "Link could not be send.", 176 | "description": "Error message on server failure" 177 | }, 178 | "sendLinkYes": { 179 | "message": "Link successfully send.", 180 | "description": "Message after send the link" 181 | }, 182 | "bookmarkTab": { 183 | "message": "Bookmark direct to server", 184 | "description": "Bookmark to server without autosync" 185 | }, 186 | "ManAuto": { 187 | "message": "Activate automatic synchronization", 188 | "description": "Enable autosync" 189 | }, 190 | "optionsLastLogged": { 191 | "message": "Last logged in with", 192 | "description": "Last logged in info" 193 | }, 194 | "optionsRestoreServer": { 195 | "message": "The following clients can be restored from the server. Please select a client from the list or click on cancel to not use any of these clients.", 196 | "description": "Restoring a client" 197 | }, 198 | "optionsLogfile": { 199 | "message": "Logfile", 200 | "description": "Logfile tab in options" 201 | }, 202 | "optionsChangelog": { 203 | "message": "Changelog", 204 | "description": "Changelog tab in options" 205 | }, 206 | "optionsLogin": { 207 | "message": "Login", 208 | "description": "Login button in options" 209 | }, 210 | "optionsClientName": { 211 | "message": "Client Name", 212 | "description": "Client Name label in options" 213 | }, 214 | "optionsTabs": { 215 | "message": "Tabs", 216 | "description": "Enable \"Synchronize open tabs\" in options" 217 | }, 218 | "optionsTabsHint": { 219 | "message": "Synchronize open tabs between the clients", 220 | "description": "Tooltip text for syncing tabs" 221 | }, 222 | "optionsLegendServer": { 223 | "message": "Server", 224 | "description": "Descriptive label for Server in options" 225 | }, 226 | "optionsLegendBookmarks": { 227 | "message": "Bookmarks", 228 | "description": "Descriptive label for Bookmarks in options" 229 | }, 230 | "optionsBTNBackup": { 231 | "message": "Backup", 232 | "description": "Backup button in options" 233 | }, 234 | "optionsBAPIHint": { 235 | "message": "The Bookmark API is not supported in this browser. Automatic synchronization is therefore deactivated." 236 | }, 237 | "optionsPuDelConfirm": { 238 | "message": "Should the selected bookmarks be removed?" 239 | } 240 | } -------------------------------------------------------------------------------- /_locales/pl/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensionDescription": { 3 | "message": "Rozszerzenie to umożliwia synchronizację zakładek i kart z samodzielnie obsługiwanym serwerem." 4 | }, 5 | "optionsStartup": { 6 | "message": "Uruchomienie" 7 | }, 8 | "optionsStartupHint": { 9 | "message": "Można to włączyć po „Importuj” lub „Usuń" 10 | }, 11 | "optionsShowLog": { 12 | "message": "Pokaż plik dziennika" 13 | }, 14 | "extensionName": { 15 | "message": "SyncMarks" 16 | }, 17 | "optionsServerData": { 18 | "message": "Dane serwera" 19 | }, 20 | "optionsServerType": { 21 | "message": "Sztuka serwera" 22 | }, 23 | "optionsServerURL": { 24 | "message": "Adres URL serwera" 25 | }, 26 | "optionsUsername": { 27 | "message": "Nazwa użytkownika" 28 | }, 29 | "optionsUsernameHint": { 30 | "message": "Nazwa użytkownika" 31 | }, 32 | "optionsPassword": { 33 | "message": "hasło" 34 | }, 35 | "optionsPasswordHint": { 36 | "message": "hasło" 37 | }, 38 | "optionsSyncOptions": { 39 | "message": "Opcje synchronizacji" 40 | }, 41 | "optionsAuto": { 42 | "message": "Automatyczna synchronizacja" 43 | }, 44 | "optionsBeforeExport": { 45 | "message": "Wszystkie zakładki są usuwane na serwerze przed eksportem. Następnie nowe zakładki są eksportowane na serwer.\n\nCzy zdalne zakładki powinny zostać usunięte przed eksportem?" 46 | }, 47 | "errorGetBookmarks": { 48 | "message": "Wystąpił błąd podczas pobierania zakładek z serwera. Odpowiedź statusu to: " 49 | }, 50 | "optionsBTNImportHint": { 51 | "message": "Przywracanie z serwera, nadpisywanie lokalnych zakładek." 52 | }, 53 | "optionsNotUsed": { 54 | "message": "Można teraz synchronizować zakładki z serwera." 55 | }, 56 | "optionsLoginError": { 57 | "message": "Błąd logowania: Zaloguj się ponownie" 58 | }, 59 | "infoRestoreID": { 60 | "message": "Czy stary klient powinien zostać usunięty z serwera, aby uniknąć problemów z synchronizacją?" 61 | }, 62 | "optionsCreate": { 63 | "message": "Utwórz" 64 | }, 65 | "optionsChange": { 66 | "message": "Zmiana" 67 | }, 68 | "optionsRemove": { 69 | "message": "Usunąć" 70 | }, 71 | "optionsManualActions": { 72 | "message": "Działania ręczne" 73 | }, 74 | "optionsBTNRemove": { 75 | "message": "Usunąć" 76 | }, 77 | "optionsBTNRemoveHint": { 78 | "message": "Spowoduje to usunięcie wszystkich lokalnych zakładek!" 79 | }, 80 | "optionsBTNImport": { 81 | "message": "Pobierz" 82 | }, 83 | "optionsBTNSaveHint": { 84 | "message": "Zapisz ustawienia" 85 | }, 86 | "optionsBTNSettingsHint": { 87 | "message": "Ustawienia kopii zapasowej" 88 | }, 89 | "optionsBTNExport": { 90 | "message": "Przesyłanie" 91 | }, 92 | "optionsBTNExportHint": { 93 | "message": "Nadpisanie wszystkich zakładek na serwerze." 94 | }, 95 | "optionsBTNSave": { 96 | "message": "Zapisz" 97 | }, 98 | "optionsBTNSettings": { 99 | "message": "Ustawienia" 100 | }, 101 | "optionsBTNRestore": { 102 | "message": "Przywracanie" 103 | }, 104 | "optionsBTNClear": { 105 | "message": "Usuń" 106 | }, 107 | "optionsDebugLog": { 108 | "message": "Dziennik debugowania" 109 | }, 110 | "optionsBTNAdvSet": { 111 | "message": "Ustawienia zaawansowane" 112 | }, 113 | "optionsBTNYes": { 114 | "message": "Tak" 115 | }, 116 | "optionsBTNNo": { 117 | "message": "Nie" 118 | }, 119 | "optionsBTNCancel": { 120 | "message": "Anuluj" 121 | }, 122 | "optionsErrorURL": { 123 | "message": "Logowanie nie powiodło się: Sprawdź adres URL WebDAV. Powinien on mieć postać" 124 | }, 125 | "optionsErrorUser": { 126 | "message": "Logowanie nie powiodło się: Sprawdź nazwę użytkownika i hasło." 127 | }, 128 | "optionsSuccessSave": { 129 | "message": "Zapisane opcje." 130 | }, 131 | "optionsErrorLogin": { 132 | "message": "Logowanie nie powiodło się: Stan: " 133 | }, 134 | "optionsBeforeCImpExp": { 135 | "message": "W tym miejscu można przywrócić istniejące ustawienia klienta z serwera." 136 | }, 137 | "optionsBeforeLogin": { 138 | "message": "Zaloguj się przy użyciu danych dostępu, aby otrzymać kod dostępu" 139 | }, 140 | "optionsWrongAData": { 141 | "message": "Błąd logowania. Zaloguj się ponownie" 142 | }, 143 | "optionsSuccessImport": { 144 | "message": "Pomyślny import." 145 | }, 146 | "optionsBeforeImport": { 147 | "message": "Czy wszystkie lokalne zakładki powinny zostać usunięte przed importem?" 148 | }, 149 | "optionsInfoRemove": { 150 | "message": "Po kontynuowaniu wszystkie bieżące zakładki zostaną usunięte.\n\nCzy na pewno chcesz usunąć wszystkie lokalne zakładki?" 151 | }, 152 | "popupBTNOptions": { 153 | "message": "Opcje" 154 | }, 155 | "popupNoSync": { 156 | "message": "Nie przeprowadzono jeszcze synchronizacji uruchamiania." 157 | }, 158 | "popupImportConfirm": { 159 | "message": "Zakładki zapisane na serwerze zostały dodane. Czy na pewno?" 160 | }, 161 | "errorSaveBookmarks": { 162 | "message": "Wystąpił błąd podczas zapisywania wszystkich zakładek. Odpowiedź statusu to: " 163 | }, 164 | "errorSaveSingleBookmarks": { 165 | "message": "Wystąpił błąd podczas zapisywania zakładki w PHP. Odpowiedź statusu to: " 166 | }, 167 | "errorExportBookmarks": { 168 | "message": "Wystąpił problem z eksportem zakładek." 169 | }, 170 | "errorImportBookmark": { 171 | "message": "Wystąpił błąd podczas importowania zakładki: " 172 | }, 173 | "errorRemoveBookmark": { 174 | "message": "Wystąpił błąd podczas usuwania zakładki." 175 | }, 176 | "errorEditBookmark": { 177 | "message": "Wystąpił błąd podczas edycji zakładki na serwerze." 178 | }, 179 | "errorMoveBookmark": { 180 | "message": "Wystąpił błąd przenoszenia zakładki na serwerze PHP. Odpowiedź statusu to: " 181 | }, 182 | "successExportBookmarks": { 183 | "message": "Lokalne zakładki zostały pomyślnie dodane na serwerze." 184 | }, 185 | "successImportBookmarks": { 186 | "message": " zaimportowanych zakładek/folderów." 187 | }, 188 | "internalError": { 189 | "message": "Wystąpił błąd wewnętrzny. Wiadomość brzmiała: " 190 | }, 191 | "infoNewClient": { 192 | "message": "Ta przeglądarka jest nowym klientem i jest teraz zarejestrowana na serwerze." 193 | }, 194 | "infoNoChange": { 195 | "message": "0 dodanych, przeniesionych lub usuniętych zakładek podczas ostatniej synchronizacji." 196 | }, 197 | "infoChanges": { 198 | "message": " zmian na serwerze od ostatniej synchronizacji." 199 | }, 200 | "infoEmptyConfig": { 201 | "message": "Konfiguracja jest pusta. Skonfiguruj dodatek przed użyciem." 202 | }, 203 | "sendPage": { 204 | "message": "Wyślij stronę" 205 | }, 206 | "sendTab": { 207 | "message": "Karta Wyślij" 208 | }, 209 | "sendLink": { 210 | "message": "Wyślij łącze" 211 | }, 212 | "sendLinkNot": { 213 | "message": "Nie można wysłać linku." 214 | }, 215 | "sendLinkYes": { 216 | "message": "Link został pomyślnie wysłany." 217 | }, 218 | "openBackend": { 219 | "message": "Otwarty serwer" 220 | }, 221 | "bookmarkTab": { 222 | "message": "Zakładka bezpośrednio na serwerze" 223 | }, 224 | "backendType": { 225 | "message": "Wybór między Syncmarks a serwerem WebDAV" 226 | }, 227 | "ManAuto": { 228 | "message": "Aktywacja automatycznej synchronizacji" 229 | }, 230 | "toBackend": { 231 | "message": "Wyślij zakładkę bezpośrednio ręcznie na serwer" 232 | }, 233 | "optionsLastLogged": { 234 | "message": "Ostatnio zalogowany za pomocą" 235 | }, 236 | "optionsRestoreServer": { 237 | "message": "Następujący klienci mogą zostać przywróceni z serwera. Wybierz klienta z listy lub kliknij Anuluj, aby nie używać żadnego z tych klientów." 238 | }, 239 | "optionsLogfile": { 240 | "message": "Plik dziennika" 241 | }, 242 | "optionsChangelog": { 243 | "message": "Dziennik zmian" 244 | }, 245 | "optionsLogin": { 246 | "message": "Logowanie" 247 | }, 248 | "optionsClientName": { 249 | "message": "Nazwa klienta" 250 | }, 251 | "optionsBackendSyncmarks": { 252 | "message": "Serwer Syncmarks" 253 | }, 254 | "optionsLegendServer": { 255 | "message": "Serwer" 256 | }, 257 | "optionsBTNBackup": { 258 | "message": "Kopia zapasowa" 259 | }, 260 | "optionsLegendBookmarks": { 261 | "message": "Zakładki" 262 | }, 263 | "optionsTabs": { 264 | "message": "Karta" 265 | }, 266 | "optionsTabsHint": { 267 | "message": "Synchronizacja otwartych kart między klientami" 268 | }, 269 | "optionsBAPIHint": { 270 | "message": "Interfejs API zakładek nie jest obsługiwany w tej przeglądarce. Automatyczna synchronizacja jest zatem wyłączona." 271 | } 272 | } 273 | -------------------------------------------------------------------------------- /scripts/options.min.css: -------------------------------------------------------------------------------- 1 | body{box-sizing:border-box;background-color:#f9f9fb;margin:0;padding:0;overflow:hidden}body,button,input,textarea{font-family:Segoe UI,sans-serif;font-size:15px}button,input{border-radius:4px;border:1px solid #a9a9a9;outline:0}#wdurl{display:inline-block;width:calc(100% - 90px)}#blogin{width:75px;min-height:29px}.btm{width:50%;display:flow-root}button#lgin{margin-top:.7em;margin-right:0}#crdialog input{width:100%;box-sizing:border-box;margin-bottom:1em;padding:.25em .4em}#crdialog label{font-size:.75em}#lgini{background-color:bisque;display:none;border-radius:.3em;padding:.3em .5em;border:1px solid;border-color:#deb887;color:#b22222;font-size:.8em}#ipinfo{background:#deb887;padding:.1em .3em;border-radius:.4em}.iiinfo{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:.95em;padding-top:.5em}#lgind{margin-bottom:10px}#lginl{visibility:hidden;left:calc(50% + .2em);font-size:.9em;text-decoration:none;color:#fcffe2;cursor:pointer;z-index:1;outline:0;width:calc(100% - 90px);border-radius:.3em;border:thin solid #f44336;background-color:#ff9800;top:3.3em;position:absolute;transform:translate(-50%,0);box-shadow:0 0 0 1px #20123a0a,0 1px 2px 0 #2200330a,0 2px 1px -1px #0730721f,0 1px 6px 0 #0e0d1a1f;line-height:1.3em}#blogin.loading{background:repeating-linear-gradient(-45deg,#3498db 0 15px,#2980b9 0 20px) left/200% 100%;animation:i3 4s infinite linear}@keyframes i3{100%{background-position:right}}#confinput{display:none}fieldset{padding:10px 30px!important;border:1px solid transparent}legend{background-color:#daeff7;padding:.1em .3em;color:#3498db;border-radius:.3em;font-size:.85em;text-align:left;border:thin solid;margin-left:-20px;border-color:#b1d3f4}button{border-color:transparent;font-size:14px;letter-spacing:.5px;min-height:36px;width:115px;margin:5px;position:relative;display:inline-block;transition:all .3s;cursor:pointer}button:hover:not(:disabled){background-color:#2980b9;color:#fff}button:disabled{cursor:no-drop;pointer-events:none}input:hover{border-color:#6495ed}.browser-style .tooltiptext{visibility:hidden;width:200px;background-color:#fcffe2;color:#203;text-align:center;padding:.4em;border-radius:5px;position:absolute;z-index:1;bottom:125%;margin-left:-140px;opacity:0;transition:opacity .3s;display:inline-block;box-shadow:0 0 0 1px #20123a0a,0 1px 2px 0 #2200330a,0 2px 1px -1px #0730721f,0 1px 6px 0 #0e0d1a1f}.browser-style .tooltiptext::after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#fcffe2 transparent transparent transparent}.browser-style:hover .tooltiptext{visibility:visible;opacity:1}#clientn{visibility:collapse}.clients{visibility:visible!important}.modal{display:none;position:fixed;z-index:1;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,.4)}.modal-content{background-color:#fefefe;margin:5% auto;padding:10px;border:1px solid #888;width:80%}.close{color:#aaa;float:right;font-size:28px;font-weight:700}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer}#logsave{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='width:24px;height:24px' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z' /%3E%3C/svg%3E")}#logclear{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='width:24px;height:24px' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z' /%3E%3C/svg%3E")}.wdurl{position:absolute;top:25px;right:85px}#wdurl.valid{border-color:#32cd32;background-color:#f0fff0;color:green}#wdurl.invalid{border-color:#ff4500;background-color:bisque;color:red}.wdurl.valid:after{content:'✓';color:#32cd32}.wdurl.invalid:after{content:'×';color:red}.cframe{width:calc(100% - 30px);border:0;height:calc(100% - 150px);position:absolute}#toolbar>label{position:absolute;right:.5em;line-height:2em}#logarea{background:#fff;border:1px solid #dcdcdc;overflow:hidden;max-width:700px;width:100%;margin-top:38px;position:initial;height:calc(100% - 10px)}#logarea body{white-space:pre;font-family:consolas,courier;font-size:.9em;background:#fff;padding:10px;overflow:auto;width:100%;position:inherit;height:calc(100% - 30px)}h1 img{vertical-align:bottom;margin-right:10px;margin-bottom:-5px}.switch{position:relative;display:inline-block;width:30px;height:17px;white-space:nowrap;margin-top:10px;cursor:pointer}.switch:has(input[disabled]){cursor:not-allowed;color:#a9a9a9}.switch:has(input[disabled]) .slider{background-color:#dcdcdc}span.lbl{padding-left:30px;margin-top:-1px;position:absolute}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.2s;transition:.2s}.slider:before{position:absolute;content:"";height:13px;width:13px;left:2px;bottom:2px;background-color:#fff;-webkit-transition:.2s;transition:.2s}input:checked+.slider{background-color:#2196f3}input:focus+.slider{box-shadow:0 0 1px #2196f3}input:checked+.slider:before{-webkit-transform:translateX(13px);-ms-transform:translateX(13px);transform:translateX(13px)}.slider.round{border-radius:17px}.slider.round:before{border-radius:50%}.modal{display:none;position:fixed;z-index:1;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,.4)}button:not(:disabled){background-color:#3498db;color:#fff}.modal button{width:44%;margin-left:10px;margin-top:20px;transition:all .3s}.modal button:hover{background-color:#2980b9;color:#fff}.modal-content{background-color:#fefefe;margin:15% auto;padding:20px;border:1px solid #888;width:80%;max-width:350px;border-radius:5px;box-shadow:.3em .3em .3em 0 rgb(0 0 0 / 35%)}.close{color:#aaa;float:right;font-size:28px;font-weight:700;position:relative;margin-top:-.5em;margin-right:-.4em}.mtext{padding-top:10px;position:relative;display:block}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer}.ocontainer{display:block;text-align:center;background-color:#fff;margin:15px;padding:30px;box-shadow:0 8px 12px 1px rgba(29,17,51,.04),0 3px 16px 2px rgba(9,32,77,.12),0 5px 10px -3px rgba(29,17,51,.12);border-radius:8px}.btnc .toptionc{display:contents}.toptionc{position:relative;text-align:left}#cimport{width:100%;height:32px;border-radius:5px;outline:0;margin-top:10px;border:1px solid #a9a9a9}#changelog{overflow:auto;position:absolute;right:0;left:0;top:95px;bottom:0;padding:5px 30px;font-family:Consolas,Courier,Monospace}.tab-bar button{border-radius:0;margin:0;padding:0;display:block;width:calc(100% / 3);float:left;min-height:unset;height:25px;background-color:#f5f5f5;color:unset}.tab-bar button:hover{background-color:#a9a9a9}.tab-button>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;display:block;padding:0 3px}.abutton{background-color:#696969!important;color:#fff!important}.tab-bar{box-shadow:0 0 0 1px #20123a0a,0 1px 2px 0 #2200330a,0 2px 1px -1px #0730721f,0 1px 6px 0 #0e0d1a1f;margin-bottom:10px;background-color:#fff}h1{margin-top:0;padding:5px 20px 0;font-size:1.5em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-bottom:10px}.otabs{padding:0;max-width:700px;width:100%;height:calc(100% - 84px);position:absolute;top:84px;z-index:0;margin-left:auto;margin-right:auto;left:0;right:0}.server .toptionc{display:block;white-space:nowrap;width:100%}.server .toptionc label{text-align:left;display:block;font-size:.75em}.server .toptionc input{display:flex;width:calc(100% - .7em);padding:.25em .4em}.server div{margin:6px 0}.exp_content{background-color:#f1f1f1;transition:max-height .2s ease-out;max-height:0;overflow:hidden;border-bottom-left-radius:4px;border-bottom-right-radius:4px;margin-bottom:10px;border:1px solid transparent;border-top:0;margin-left:10px;width:calc(100% - 17px)}.exp_content.active{border:1px solid #1e90ff;border-top:0}.collapsible{text-align:left;font-size:.8em;letter-spacing:unset;margin:unset;min-height:unset;width:calc(100% - 15px);margin-left:10px}.collapsible::after{content:'\002B';float:right}.collapsible.active::after{content:"\2212"}.collapsible.active{background-color:#1e90ff;color:#fff;border-bottom-left-radius:0;border-bottom-right-radius:0}.collapsible:hover{background-color:#696969!important}#wmessage{background-color:transparent;color:#555;text-align:center;padding:10px 20px 30px 20px;position:absolute;z-index:1;border:0 solid;border-radius:5px;margin:0 auto;bottom:-80px;border-top:0;border-bottom-left-radius:0;border-bottom-right-radius:0;box-shadow:0 0 0 1px #20123a0a,0 1px 2px 0 #2200330a,0 2px 1px -1px #0730721f,0 1px 6px 0 #0e0d1a1f;left:0;right:0;opacity:0;transition:opacity 1s}#wmessage.show{animation-name:bounceInUp;animation-duration:1s;animation-fill-mode:both;bottom:-20px;opacity:1}@keyframes bounceInUp{0%,100%,60%,75%,90%{transition-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,700px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,5px,0)}90%{transform:translate3d(0,-5px,0)}100%{transform:translate3d(0,0,0)}}#wmessage.hide{animation-name:slideInDown;animation-duration:.5s;animation-fill-mode:both}@keyframes slideInDown{0%{transform:translateY(-70%);visibility:visible}100%{transform:translateY(0)}}#toolbar{background:#dcdcdc;position:absolute;left:0;right:-2px;top:0;margin:0;padding:0 0 0 1px;border-bottom:1px solid #dcdcdc}#toolbar button{cursor:pointer;background-repeat:no-repeat;background-size:24px;background-position:5px;padding:0 10px 0 30px;position:relative;line-height:25px;min-height:27px}.btnc{display:flex;flex-flow:row wrap}.btnc .bmarks{flex:1}.btnc fieldset{margin-top:0}.btnc .sett{margin-left:0}@media all and (max-width:560px){.btnc .sett{width:100%;margin-left:15px!important}} -------------------------------------------------------------------------------- /_locales/de/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensionName": { 3 | "message": "SyncMarks", 4 | "description": "Name der Erweiterung." 5 | }, 6 | "extensionDescription": { 7 | "message": "Mit Hilfe dieser Erweiterung synchronisieren Sie Lesezeichen und Tabs mit einem selbstgehosteten Server." 8 | }, 9 | "optionsServerURL": { 10 | "message": "Server URL", 11 | "description": "URL to the backend" 12 | }, 13 | "optionsUsername": { 14 | "message": "Benutzername", 15 | "description": "Username" 16 | }, 17 | "optionsPassword": { 18 | "message": "Passwort", 19 | "description": "Password" 20 | }, 21 | "optionsSyncOptions": { 22 | "message": "Optionen", 23 | "description": "Sync Options" 24 | }, 25 | "optionsAuto": { 26 | "message": "Automatische Synchronisation" 27 | }, 28 | "optionsManualActions": { 29 | "message": "Manuelle Funktionen", 30 | "description": "Manual Actions" 31 | }, 32 | "optionsBTNImport": { 33 | "message": "Download" 34 | }, 35 | "optionsBTNImportHint": { 36 | "message": "Wiederherstellen vom Server, überschreiben der lokalen Bookmarks.", 37 | "description": "Import Button Hint." 38 | }, 39 | "optionsBTNSettingsHint": { 40 | "message": "Backup der Einstellungen" 41 | }, 42 | "optionsBTNExport": { 43 | "message": "Upload" 44 | }, 45 | "optionsBTNExportHint": { 46 | "message": "Überschreiben aller Bookmarks auf dem Server.", 47 | "description": "Export Button Hint." 48 | }, 49 | "optionsBTNSave": { 50 | "message": "Speichern", 51 | "description": "Save Button." 52 | }, 53 | "optionsBTNSettings": { 54 | "message": "Einstellungen" 55 | }, 56 | "optionsBTNRestore": { 57 | "message": "Wiederherstellen" 58 | }, 59 | "optionsBTNClear": { 60 | "message": "Löschen" 61 | }, 62 | "optionsDebugLog": { 63 | "message": "Debug Log" 64 | }, 65 | "optionsBTNYes": { 66 | "message": "Ja", 67 | "description": "Yes Button." 68 | }, 69 | "optionsBTNNo": { 70 | "message": "Nein", 71 | "description": "No Button." 72 | }, 73 | "optionsBTNCancel": { 74 | "message": "Abbrechen", 75 | "description": "Cancel Button." 76 | }, 77 | "optionsNotUsed": { 78 | "message": "Du kannst nun alle Bookmarks vom Server Synchronisieren.", 79 | "description": "Not used hint." 80 | }, 81 | "optionsErrorURL": { 82 | "message": "Login Fehler: Bitte prüfe den URL. Dieser sollte im Format https://servername/folder sein", 83 | "description": "Login failed, wrong URL." 84 | }, 85 | "optionsErrorUser": { 86 | "message": "Login Fehler: Bitte prüfe Benutzer und Passwort.", 87 | "description": "Login failed, wrong User." 88 | }, 89 | "optionsSuccessSave": { 90 | "message": "Option gespeichert.", 91 | "description": "Login failed, wrong User." 92 | }, 93 | "optionsErrorLogin": { 94 | "message": "Login Fehler: Status: ", 95 | "description": "Login failed, unknown state." 96 | }, 97 | "optionsLoginError": { 98 | "message": "Login Fehler: Bitte erneut einloggen" 99 | }, 100 | "optionsBeforeCImpExp": { 101 | "message": "Hier kannst du deine bestehenden Client Einstellungen vom Server wiederherstellen." 102 | }, 103 | "optionsBeforeLogin": { 104 | "message": "Bitte melden Sie sich mit Ihren Zugangsdaten an, um Zugang zu Ihren Lesezeichen zu erhalten" 105 | }, 106 | "optionsWrongAData": { 107 | "message": "Login Error. Bitte erneut einloggen" 108 | }, 109 | "infoRestoreID": { 110 | "message": "Soll der alte Client auf dem Server entfernt werden, um Synchronisations Probleme zu vermeiden?" 111 | }, 112 | "optionsSuccessImport": { 113 | "message": "Import gelungen." 114 | }, 115 | "optionsBeforeImport": { 116 | "message": "Sollen alle lokalen Bookmarks vor dem Import gelöscht werden?", 117 | "description": "Message before importing." 118 | }, 119 | "optionsBeforeExport": { 120 | "message": "Vor dem Export werden alle Bookmarks auf dem Server gelöscht. Danach werden die neuen Bookmarks zum Server exportiert.\n\nSollen die Bookmarks vor dem Export auf dem Server gelöscht werden?" 121 | }, 122 | "optionsInfoRemove": { 123 | "message": "Wenn du fortfährst, werden alle deine aktuellen Bookmarks entfernt.\n\nSollen alle lokalen Bookmarks gelöscht werden?", 124 | "description": "Login failed, unknown state." 125 | }, 126 | "popupBTNOptions": { 127 | "message": "Optionen", 128 | "description": "Options Button." 129 | }, 130 | "popupNoSync": { 131 | "message": "Bisher wurde kein Sync beim Start durchgeführt.", 132 | "description": "No startup sync done yet.." 133 | }, 134 | "popupImportConfirm": { 135 | "message": "Die Bookmarks werden nun vom Server übernommen. Bist du sicher?", 136 | "description": "ImportConfirm" 137 | }, 138 | "errorGetBookmarks": { 139 | "message": "Es gab einen Fehler beim Abrufen der Bookmarks vom Server. Der Antwortcode vom Server lautet: ", 140 | "description": "http Fehler beim Abrufen der Bookmarks." 141 | }, 142 | "errorSaveBookmarks": { 143 | "message": "Es gab einen Fehler beim Speichern aller Bookmarks. Die Rückmeldung lautet: ", 144 | "description": "http error beim Speichern der Bookmarks." 145 | }, 146 | "errorSaveSingleBookmarks": { 147 | "message": "Es gab einen Fehler beim Speichern des Bookmarks auf dem PHP Server. Die Rückmeldung lautet: ", 148 | "description": "http error when saving single bookmark." 149 | }, 150 | "errorExportBookmarks": { 151 | "message": "Es gab einen Fehler beim Export der Bookmarks.", 152 | "description": "Fehler beim exportieren der Bookmarks." 153 | }, 154 | "errorImportBookmark": { 155 | "message": "Es gab einen Fehler beim Import des Bookmarks: ", 156 | "description": "Error when import bookmark." 157 | }, 158 | "errorRemoveBookmark": { 159 | "message": "Es gab einen Fehler beim Entfernen des Bookmarks.", 160 | "description": "Fehler beim Entfernen des Bookmarks mit PHP." 161 | }, 162 | "errorEditBookmark": { 163 | "message": "Es gab einen Fehler beim Ändern des Bookmarks auf dem Server." 164 | }, 165 | "errorMoveBookmark": { 166 | "message": "Es gab einen Fehler beim Verschieben des Bookmarks auf dem PHP-Server. Die Rückmeldung lautet: ", 167 | "description": "Fehler beim Verschieben des Bookmarks." 168 | }, 169 | "successExportBookmarks": { 170 | "message": "Lokale Bookmarks erfolgreich auf dem Server hinzugefügt.", 171 | "description": "Alle Bookmarks erfolgreich exportiert." 172 | }, 173 | "successImportBookmarks": { 174 | "message": " Bookmark/Ordner importiert.", 175 | "description": "Count bookmarks imported." 176 | }, 177 | "internalError": { 178 | "message": "Ein interner Fehler ist aufgetreten. Die Meldung lautet: ", 179 | "description": "Interner Fehler." 180 | }, 181 | "infoNewClient": { 182 | "message": "Dieser Browser ist ein neuer Client und wurde auf dem Server registriert.", 183 | "description": "New Client, unknown to the server." 184 | }, 185 | "infoNoChange": { 186 | "message": "Keine Bookmarks hinzugefügt, verschoben oder gelöscht bei der letzten Synchronisation.", 187 | "description": "Meldung, wenn sich auf dem Server keine Daten verändert haben." 188 | }, 189 | "infoChanges": { 190 | "message": " Änderungen auf dem Server seit dem letzten Sync.", 191 | "description": "Message if no data has changed on the server." 192 | }, 193 | "infoEmptyConfig": { 194 | "message": "Keine Konfigurationsdaten gefunden. Bitte konfiguriere das AddOn vor der ersten Verwendung.", 195 | "description": "Message if extension is not configured yet." 196 | }, 197 | "sendPage": { 198 | "message": "Seite senden" 199 | }, 200 | "sendTab": { 201 | "message": "Tab senden" 202 | }, 203 | "sendLink": { 204 | "message": "Link senden" 205 | }, 206 | "sendLinkNot": { 207 | "message": "Link konnte nicht versendet werden." 208 | }, 209 | "sendLinkYes": { 210 | "message": "Link erfolgreich versendet." 211 | }, 212 | "openBackend": { 213 | "message": "Öffne Server" 214 | }, 215 | "bookmarkTab": { 216 | "message": "Bookmark direkt zu Server" 217 | }, 218 | "ManAuto": { 219 | "message": "Automatische Synchronisation aktivieren" 220 | }, 221 | "optionsLastLogged": { 222 | "message": "Zuletzt eingeloggt mit" 223 | }, 224 | "optionsRestoreServer": { 225 | "message": "Folgende Clients können vom Server wiederhergestellt werden. Bitte wähle einen Client aus der Liste aus oder klicke auf abbrechen, um keinen dieser Client zu verwenden." 226 | }, 227 | "optionsChangelog": { 228 | "message": "Änderungen" 229 | }, 230 | "optionsLogin": { 231 | "message": "Login" 232 | }, 233 | "optionsLogfile": { 234 | "message": "Logdatei" 235 | }, 236 | "optionsClientName": { 237 | "message": "Client Name" 238 | }, 239 | "optionsBackendSyncmarks": { 240 | "message": "Syncmarks Server" 241 | }, 242 | "optionsTabs": { 243 | "message": "Tabs" 244 | }, 245 | "optionsTabsHint": { 246 | "message": "Synchronisiere offene Tabs zwischen den Clients" 247 | }, 248 | "optionsLegendServer": { 249 | "message": "Server" 250 | }, 251 | "optionsLegendBookmarks": { 252 | "message": "Bookmarks" 253 | }, 254 | "optionsBTNBackup": { 255 | "message": "Backup" 256 | }, 257 | "optionsBAPIHint": { 258 | "message": "Die Bookmark API wird in diesem Browser nicht unterstützt. Die Automatische Synchronisation wird daher deaktiviert." 259 | }, 260 | "optionsPuDelConfirm": { 261 | "message": "Sollen die markierten Bookmarks gelöscht werden?" 262 | } 263 | } 264 | -------------------------------------------------------------------------------- /scripts/popup.css: -------------------------------------------------------------------------------- 1 | html { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | body { 6 | border: 0; 7 | margin: 0; 8 | padding: 0; 9 | height: 490px; 10 | width: 320px; 11 | font-size: 100%; 12 | } 13 | #svgfilled { 14 | display: none; 15 | color: gold; 16 | } 17 | #toolbar { 18 | background-color: #0879d9; 19 | position: absolute; 20 | left: 0; 21 | right: 0; 22 | top: 0; 23 | bottom: 40px; 24 | } 25 | #search { 26 | border: 1px solid transparent; 27 | outline: 0; 28 | line-height: 2.5em; 29 | border-radius: 20px; 30 | top: 7px; 31 | position: absolute; 32 | right: 3.5em; 33 | left: 3.5em; 34 | padding: 0 10px 0 25px; 35 | background-color: #0e62a9; 36 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%230879d9' d='M416 208c0 45.9-14.9 88.3-40 122.7l126.6 126.7c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z'/%3E%3C/svg%3E"); 37 | background-repeat: no-repeat; 38 | background-size: 15px; 39 | background-position: 5px; 40 | color: #0e62a9; 41 | } 42 | #search:hover { 43 | background-color: #96caf5; 44 | } 45 | #search:focus { 46 | border: 1px solid blue !important; 47 | outline: 0 !important; 48 | background-color: #96caf5; 49 | } 50 | #toolbar button { 51 | outline: 0; 52 | top: .8em; 53 | position: absolute; 54 | background-color: transparent; 55 | cursor: pointer; 56 | margin: 0; 57 | padding: 0; 58 | border: 0; 59 | } 60 | #toolbar button:disabled { 61 | cursor: auto; 62 | } 63 | button > svg { 64 | height: 2em; 65 | color: #96caf5; 66 | } 67 | button:not([disabled]) > svg:hover { 68 | color: #e7f4ff; 69 | } 70 | button:disabled > svg { 71 | color: cornflowerblue; 72 | } 73 | #settings { 74 | left: 10px; 75 | } 76 | #addbm { 77 | right: 10px; 78 | } 79 | #bookmarks { 80 | background-color: #eef3fa; 81 | white-space: nowrap; 82 | overflow-x: hidden; 83 | overflow-y: auto; 84 | top: 3em; 85 | bottom: 0; 86 | position: absolute; 87 | width: 100%; 88 | padding: 5px 0; 89 | font-size: 1em; 90 | font-family: Sans-serif; 91 | } 92 | #bookmarks ol.tree { 93 | padding: 0 0 0 20px; 94 | width: 90% 95 | } 96 | #bookmarks > li.file { 97 | margin-left: 29px !important; 98 | } 99 | #bookmarks li { 100 | position: relative; 101 | margin: 0 20px; 102 | list-style: none; 103 | } 104 | #bookmarks li.file { 105 | margin-left: -2px !important; 106 | } 107 | #bookmarks li.file span { 108 | background-size: 16px; 109 | color: #000; 110 | padding-left: 23px; 111 | text-decoration: none; 112 | display: block; 113 | white-space: nowrap; 114 | overflow: hidden; 115 | text-overflow: ellipsis; 116 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath fill='%23dff0fe' d='M39,20c0,10.578-8.618,19-19,19C9.619,39,1,30.578,1,20S9.422,1,20,1S39,9.422,39,20z'%3E%3C/path%3E%3Cpath fill='%2398ccfd' d='M27.124 26.951c.432.215.864.215 1.081.647.647.649.647 1.728.864 2.376.215.864.432 1.727.864 2.591.216 1.081.648 2.16.864 3.023.141-.11.306-.213.463-.318C35.927 31.822 39 26.302 39 20c0-5.597-2.373-10.575-6.161-14.037-.459-.151-.93-.165-1.396.042-.648.217-1.079 1.081-1.511 1.512-.432.648-.864 1.295-1.295 1.943-.217.216-.432.648-.217.864 0 .216.217.216.432.216.432.217.649.217 1.081.432.216 0 .432.217.216.432 0 0 0 .217-.216.217-1.081 1.08-2.159 1.943-3.239 3.022-.216.216-.432.648-.432.864 0 .216.216.216.216.432 0 .217-.216.217-.432.432-.432.217-.864.432-1.08.649-.216.432 0 1.08-.216 1.511-.216 1.079-.865 1.943-1.297 3.023-.432.647-.647 1.295-1.078 1.943 0 .864-.217 1.511.215 2.159C23.67 27.166 25.612 26.302 27.124 26.951zM26.725 2.21C24.638 1.432 22.375 1 20 1c-.391 0-.776.019-1.161.041-.27.419-.485.832-.566 1.078-.216 1.079.648.864 1.511 1.079 0 0 .216 1.727.216 1.943.216 1.081-.432 1.727-.432 2.807 0 .648 0 1.727.432 2.159h.216c.216 0 .432-.216.864-.432.648-.432 1.296-1.079 1.943-1.511.649-.432 1.296-1.079 1.728-1.511.648-.432 1.079-1.295 1.295-1.944.216-.432.956-1.704.739-2.351C26.769 2.323 26.746 2.263 26.725 2.21zM1.432 20.902c.648 1.295 1.943 2.592 3.239 3.454.864.648 2.591.648 3.454 1.727.648.865.432 1.943.432 3.023 0 1.295.864 2.375 1.295 3.453.216.649.432 1.512.648 2.16 0 .216.216 1.511.216 1.727.069.035.126.114.177.212 1.153.632 2.378 1.14 3.657 1.524.016.001.037-.012.053-.008.216 0 1.08-1.296 1.08-1.512.648-.648 1.079-1.511 1.727-1.943.432-.216.864-.432 1.295-.865.432-.432.648-1.295.864-1.943.216-.431.432-1.294.216-1.942-.137-.41-.216-.648-.648-.864-1.295-.432-2.591-.432-3.67-1.512-.216-.432-.216-.864-.432-1.295-.432-.432-1.511-.648-2.159-.864h-2.807H8.557c-.648-.216-1.079-1.08-1.511-1.727 0-.216 0-.649-.432-.649-.432-.215-.864.217-1.295 0-.216-.215-.216-.432-.216-.647 0-.649.432-1.296.864-1.728C6.614 20.253 7.262 20.9 7.909 20.9c.216 0 .216 0 .432.216.648.216.864 1.079.864 1.728v.432c0 .216.216.216.432.216.216-1.079.216-2.16.432-3.239 0-1.295 1.295-2.592 2.375-3.023.432-.215.648.217 1.079 0 1.295-.432 4.534-1.727 3.886-3.453-.432-1.512-1.727-3.022-3.454-2.807-.432.217-.648.432-1.079.649-.648.432-1.943 1.727-2.591 1.727-1.079-.216-1.079-1.727-.864-2.376.216-.864 2.159-3.669 3.454-3.238.216.216.648.648.864.864.432.216 1.08.216 1.727.216.216 0 .432 0 .648-.216.216-.216.216-.216.216-.432 0-.648-.648-1.296-1.079-1.728-.432-.432-1.08-.864-1.727-1.078-1.38-.415-4.295.076-6.672.878C3.24 9.685 1 14.553 1 20c0 .091.009.18.01.271C1.164 20.489 1.312 20.702 1.432 20.902z'%3E%3C/path%3E%3Cpath fill='%234788c7' d='M20,2c10.093,0,18,7.907,18,18c0,9.925-8.075,18-18,18S2,29.925,2,20C2,9.907,9.907,2,20,2 M20,1 C9.422,1,1,9.422,1,20s8.619,19,19,19c10.382,0,19-8.422,19-19S30.578,1,20,1L20,1z'%3E%3C/path%3E%3C/svg%3E"); 117 | background-repeat: no-repeat; 118 | background-position: 0; 119 | -webkit-touch-callout: none !important; 120 | -webkit-user-select: none !important; 121 | -moz-user-select: none !important; 122 | -ms-user-select: none !important; 123 | -o-user-select: none !important; 124 | user-select: none !important; 125 | max-width: fit-content; 126 | cursor: pointer; 127 | } 128 | #bookmarks li input { 129 | position: absolute; 130 | left: 0; 131 | margin-left: 0; 132 | opacity: 0; 133 | z-index: 2; 134 | cursor: pointer; 135 | height: 1em; 136 | width: 1em; 137 | top: 0; 138 | } 139 | #bookmarks li input + ol { 140 | background: transparent; 141 | background-size: 13px; 142 | background-position: 38px -2px; 143 | margin: -.938em 0 0 -44px; 144 | height: 1em; 145 | text-overflow: ellipsis; 146 | } 147 | #bookmarks li input + ol > li { 148 | display: none; 149 | padding-left: 1px; 150 | } 151 | #bookmarks li label { 152 | cursor: pointer; 153 | display: block; 154 | font-size: 1em; 155 | line-height: 1.6em; 156 | text-overflow: ellipsis; 157 | overflow: hidden; 158 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath fill='%23dbb065' d='M2.5 71.5L2.5 8.5 23.793 8.5 29.793 14.5 77.5 14.5 77.5 71.5z'%3E%3C/path%3E%3Cpath fill='%23967a44' d='M23.586,9l5.707,5.707L29.586,15H30h47v56H3V9H23.586 M24,8H2v64h76V14H30L24,8L24,8z'%3E%3C/path%3E%3Cg%3E%3Cpath fill='%23f5ce85' d='M2.5 71.5L2.5 18.5 24.151 18.5 30.151 14.5 77.5 14.5 77.5 71.5z'%3E%3C/path%3E%3Cpath fill='%23967a44' d='M77,15v56H3V19h21h0.303l0.252-0.168L30.303,15H77 M78,14H30l-6,4H2v54h76V14L78,14z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E"); 159 | background-repeat: no-repeat; 160 | } 161 | #bookmarks :not(.mainFolder) label { 162 | position: unset; 163 | top: unset; 164 | width: max-content; 165 | z-index: unset; 166 | left: unset; 167 | background-color: unset; 168 | height: unset; 169 | border-bottom: unset; 170 | padding: 0 5px 0 35px; 171 | margin-left: -5px; 172 | border-radius: 3px; 173 | user-select: none; 174 | position: relative; 175 | } 176 | #bookmarks :not(.mainFolder) ol { 177 | position: unset; 178 | top: unset; 179 | z-index: unset; 180 | margin-bottom: unset !important; 181 | } 182 | #bookmarks li input:checked + ol { 183 | margin: -1.25em 0 0 -40px; 184 | padding: 1.563em 0 0 65px; 185 | height: auto; 186 | background-position: 38px 2px; 187 | } 188 | #bookmarks li input:checked + ol > li { 189 | display: block; 190 | margin: 0 0 .3em; 191 | } 192 | #bookmarks li input:checked + ol > li:last-child { 193 | margin: 0 0 .063em; 194 | } 195 | #popupMessage { 196 | visibility: hidden; 197 | width: 90%; 198 | background-color: transparent; 199 | box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; 200 | color: white; 201 | text-align: center; 202 | border-radius: 5px; 203 | padding: 3px 6px; 204 | position: fixed; 205 | z-index: 1; 206 | left: 50%; 207 | bottom: 40px; 208 | font-size: 16px; 209 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 210 | transform: translateX(-50%); 211 | transition: opacity 2s; 212 | opacity: 0; 213 | } 214 | #popupMessage.show { 215 | visibility: visible; 216 | opacity: 1; 217 | } 218 | #popupMessage.error { 219 | background-color: #f2dede; 220 | border-color: #eda6b2; 221 | color: #D8000C; 222 | } 223 | #popupMessage.warn { 224 | background-color: #FEEFB3; 225 | color: #9F6000; 226 | border-color: #eea236; 227 | } 228 | #popupMessage.success { 229 | background-color: #DFF2BF; 230 | color: #270; 231 | border-color: #a2dfa2; 232 | } 233 | #popupMessage.info { 234 | background-color: #BEF; 235 | color: #059; 236 | border-color: #74d6f3; 237 | } 238 | #loader { 239 | position: absolute; 240 | left: calc(50% - 25px); 241 | top: calc(50% - 25px); 242 | z-index: 1; 243 | } 244 | .loader { 245 | width: 50px; 246 | aspect-ratio: 1; 247 | display: grid; 248 | border: 4px solid #0000; 249 | border-radius: 50%; 250 | border-color: #ccc #0000; 251 | animation: l16 1s infinite linear; 252 | } 253 | .loader::before, .loader::after { 254 | content: ""; 255 | grid-area: 1/1; 256 | margin: 2px; 257 | border: inherit; 258 | border-radius: 50%; 259 | } 260 | .loader::before { 261 | border-color: #f03355 #0000; 262 | animation: inherit; 263 | animation-duration: .5s; 264 | animation-direction: reverse; 265 | } 266 | .loader::after { 267 | margin: 8px; 268 | } 269 | @keyframes l16 { 270 | 100%{transform: rotate(1turn)} 271 | } 272 | .bmMarked { 273 | background-color: #00000073; 274 | padding: 0 .51em; 275 | border-radius: .3em; 276 | color: white !important; 277 | } 278 | #msgBox { 279 | width: 90%; 280 | top: 35%; 281 | position: sticky; 282 | height: 100px; 283 | background: white; 284 | margin-left: auto; 285 | margin-right: auto; 286 | border-radius: 10px; 287 | box-shadow: 1px 5px 15px -8px rgba(51, 51, 51, 0.51); 288 | } 289 | #bglayer { 290 | width: 100%; 291 | background-color: #0000003b; 292 | height: 100%; 293 | position: absolute; 294 | display: none; 295 | } 296 | #msgText { 297 | width: 100%; 298 | height: 55px; 299 | padding: 5px 10px; 300 | } 301 | #msgBtn { 302 | height: 30px; 303 | position: absolute; 304 | width: 100%; 305 | text-align: center; 306 | } 307 | #msgBtn button { 308 | background-color: #2196f3; 309 | border: none; 310 | color: white; 311 | font-weight: 501; 312 | padding: 3px 10px; 313 | border-radius: 4px; 314 | box-shadow: 0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12); 315 | font-family: Roboto,"Segoe UI",BlinkMacSystemFont,system-ui; 316 | outline: 0; 317 | cursor: pointer; 318 | margin: 0 25px; 319 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # ChangeLog 2 | ## v2.1.13 3 | - Save messages in session storage 4 | 5 | ## v2.1.12 6 | - Added Turkish 7 | - Get PopUp data faster 8 | 9 | ## v2.1.11 10 | - Fix startup error 11 | 12 | ## v2.1.10 13 | - Keep PopUp open, if ctrl key is pressed 14 | - Delete Bookmarks via PopUp 15 | 16 | ## v2.1.9 17 | - Fix undefined variable 18 | 19 | ## v2.1.8 20 | - Fix onStartup.addListener 21 | 22 | ## v2.1.7 23 | - Fix tab behavior 24 | - Fix error messages in PopUp 25 | - Added Loader for PopUp 26 | 27 | ## v2.1.6 28 | - Removed direct toggle 29 | - Fixed CSS for options 30 | - Fixed Tab Sync 31 | - Fix Android Options 32 | 33 | ## v2.1.5 34 | - Add info to options, when bookmark API is unsupported 35 | - Removed option for action 36 | - Fix Clientlist 37 | - Fix popup layout in Firefox 38 | 39 | ## v2.1.4 40 | - Fix innerHTML 41 | 42 | ## v2.1.3 43 | - Fix CSS 44 | 45 | ## v2.1.2 46 | - Added PopUp 47 | - Removed action chaos 48 | - Fix delete bookmark 49 | 50 | ## v2.1.1 51 | - Added Chinese (Han Script) translation by Outbreak2096 52 | - Added Dutch translation by Vistaus 53 | - Firefox fix for requesting host permission 54 | 55 | ## v2.1.0 56 | - Removed WebDAV Support 57 | - Added Polish translation 58 | - Added Weblate as translation plattform 59 | - Updated Readme 60 | - Fix defect token 61 | - Fix client Restore 62 | 63 | ## v2.0.4 64 | - Fix response object 65 | - Remove token on invalid token 66 | 67 | ## v2.0.3 68 | - Fix open Options Page 69 | - Fix Client restore 70 | - Fix request host permissions 71 | 72 | ## v2.0.2 73 | - Fix Remove Bookmark 74 | - Add support for store/restore client settings from server 75 | 76 | ## v2.0.1 77 | - Fix bookmarkTab/permission 78 | 79 | ## v2.0.0) 80 | - Migrated to manifest v3 81 | - Added API changes 82 | - Added option host permissions 83 | - Added URL verify 84 | - Small fixes 85 | 86 | ## v1.20.20 87 | - Add check for correct backend url 88 | - Optimized feedback messages 89 | 90 | ## v1.20.19 91 | - Fixed Android bug in options 92 | - Fixed backup bug on Android 93 | - Fixed tab sync bug on Android 94 | 95 | ## v1.20.18 96 | - Added tab sync function 97 | 98 | ## v1.20.16 99 | - Fixed Initial sync with empty parent folder 100 | 101 | ## v1.20.15 102 | - Added changeIcon function 103 | 104 | ## v1.20.14 105 | - Removed FindByID 106 | - Fixed rare issue with empty URL in options 107 | 108 | ## v1.20.13 109 | - Fix in Options 110 | - Fix delete bookmark 111 | 112 | ## v1.20.11 113 | - Fixed mobile detection 114 | 115 | ## v1.20.10 116 | - Added icon context menu 117 | 118 | ## v1.20.9 (2022-08-21) 119 | - Change response 120 | 121 | ## v1.20.8 (2022-08-10) 122 | - Added Fallback to BasicAuth 123 | 124 | ## v1.20.7 (2022-06-10) 125 | - Added Debug Level to logfile 126 | 127 | ## v1.20.6 (2022-05-10) 128 | - Changed browser detection 129 | - Fixed toast/notification 130 | 131 | ## v1.20.5 (2022-05-06) 132 | - Fix exporting bookmarks 133 | 134 | ## v1.20.3 (2022-05-05) 135 | - Added toast 136 | - Small Fixes 137 | 138 | ## v1.20.0 (2022-04-22) 139 | 140 | - Standardization for requests 141 | - Simplification of functions 142 | - Popup for mobile replaced with singleclick 143 | - Bug fixes 144 | 145 | ## v1.19.7 (2022-03-20) 146 | 147 | - Disable unused options on WebDAV 148 | - Fix restore options 149 | - Fix double adding bookmarkTab 150 | 151 | ## v1.19.6 (2022-03-13) 152 | 153 | - Re-style options 154 | 155 | ## v1.19.5 (2022-03-12) 156 | 157 | - Added token based login 158 | - Fixed encoding issue 159 | - Fixed import issue 160 | - Fixed WebDAV login 161 | 162 | ## v1.19.3 (2022-02-25) 163 | 164 | - Minor Fixes 165 | 166 | ## v1.19.2 (2022-02-24) 167 | 168 | - Fix sync for un-synced client 169 | 170 | ## v1.19.1 (2022-02-21) 171 | 172 | - Streamlined client info 173 | - Fix for upload / delete / sync 174 | 175 | ## v1.18.9 (2022-02-17) 176 | 177 | - Fixed sync after pre-request 178 | 179 | ## v1.18.8 (2022-02-13) 180 | 181 | - Changes in translation 182 | - Changes for FullSync 183 | - Added autosave settings on change 184 | - Removed save button 185 | 186 | ## v1.18.7 (2022-02-05) 187 | 188 | - Added startup pre-request (in case other client made export) 189 | - Added check if command shortcut is set 190 | 191 | ## v1.18.6 (2022-01-12) 192 | 193 | - Contextmenu refresh 194 | - Fixed init 195 | 196 | ## v1.18.5 (2021-12-01) 197 | 198 | - Fix hide notification 199 | - Fix rename client 200 | - Changed default shortcut to STRG + Q 201 | 202 | ## v1.18.3 (2021-12-01) 203 | 204 | - Added option for bookmark on backend 205 | - Fix some translation 206 | 207 | ## v1.18.2 (2021-11-28) 208 | 209 | - Try fo fix fo not remove bookmark on startup 210 | 211 | ## v1.18.1 (2021-11-25) 212 | 213 | - Fix bookmarkTab 214 | - Fix notifications 215 | - Bookmark direct to server 216 | - Changed some requests 217 | 218 | ## v1.18.0 (2021-11-24) 219 | 220 | - Bookmark direct to server 221 | - Changed some requests 222 | 223 | ## v1.17.27 (2021-11-08) 224 | 225 | - Added sync info to requests 226 | - Added onInstall trigger 227 | - Fix get client name 228 | - Fix restore settings 229 | 230 | ## v1.17.26 (2021-11-02) 231 | 232 | - Button fix 233 | 234 | ## v1.17.25 (2021-10-19) 235 | 236 | - CSS Fix 237 | 238 | ## v1.17.24 (2021-06-29) 239 | 240 | - Changed Save Credentials call 241 | 242 | ## v1.17.23 (2021-06-25) 243 | 244 | - Mark pushed tab as read on tab access 245 | - Replaced getURL functions 246 | 247 | ## v1.17.22 (2021-06-24) 248 | 249 | - Another try to fix the share menu on Android 250 | 251 | ## v1.17.21 (2021-06-23) 252 | 253 | - Another try to fix the share menu on Android 254 | 255 | ## v1.17.20 (2021-06-22) 256 | 257 | - Fixed mobile share function 258 | 259 | ## v1.17.19 (2021-06-15) 260 | 261 | - Open pushed tabs as new tab (without click the notification) 262 | 263 | ## v1.17.17 (2021-06-05) 264 | 265 | - Fixing mobile CSS 266 | 267 | ## v1.17.16 (2021-04-22) 268 | 269 | - Rebuilding context menus 270 | 271 | ## v1.17.15 (2021-04-14) 272 | 273 | - Fixed retrieving of clients 274 | 275 | ## v1.17.13 (2021-03-26) 276 | 277 | - Fixed import for not existing menu\_\_\_\_\_\_\_\_ folder in Chromium 278 | 279 | ## v1.17.12 (2021-03-22) 280 | 281 | - Close session before save new options 282 | 283 | ## v1.17.11 (2021-03-20) 284 | 285 | - Fixed info message definition up 286 | - Reworked import config file 287 | - Attention!!! => Import is only compatible with WebApp > 1.4.2 288 | 289 | ## v1.17.10 (2021-03-14) 290 | 291 | - Fixed notification on error 292 | - Added Backup function to export/import config 293 | 294 | ## v1.17.9 (2021-03-04) 295 | 296 | - Added popup on Android for online bookmarks 297 | - Added permissions check 298 | - Added advanced settings 299 | - Prepare to remove WebDAV support 300 | - Fixed small glitches 301 | 302 | ## v1.17.8 (2021-02-28) 303 | 304 | - Fixed closing export dialog 305 | 306 | ## v1.17.7.3 (2021-02-27) 307 | 308 | - Removed activeTabs permission 309 | 310 | ## v1.17.7.2 (2021-02-27) 311 | 312 | - Fix for push request 313 | - Fix for not saving client name 314 | - Fix for Import 315 | - Fix for send/receive notifications 316 | - Removed tabs permission again 317 | 318 | ## v1.17.7.1 (2021-01-05) 319 | 320 | - Fix for push request 321 | - Fix for not saving client name 322 | 323 | ## v1.17.7 (2021-01-01) 324 | 325 | - Changed POST requests 326 | 327 | ## v1.17.6.11 (2020-12-27) 328 | 329 | - Fixed return value 330 | 331 | ## v1.17.6.10 (2020-12-21) 332 | 333 | - Added function to identify removed bookmarks 334 | 335 | ## v1.17.6.9 (2020-12-18) 336 | 337 | - Fix for Firefox 84 338 | - Fix for Chromium toolbar button 339 | 340 | ## v1.17.6.8 (2020-12-16) 341 | 342 | - Fixed startup subfolder support 343 | 344 | ## v1.17.6.7 (2020-12-12) 345 | 346 | - Fixed another XHR response 347 | 348 | ## v1.17.6.6 (2020-12-09) 349 | 350 | - Fixed XHR response 351 | 352 | ## v1.17.6.5 (2020-12-08) 353 | 354 | - Added some debug information to logfile 355 | - Fixed XML error 356 | 357 | ## v1.17.6.3 (2020-12-04) 358 | 359 | - Fixed folder detection 360 | 361 | ## v1.17.6.2 (2020-12-01) 362 | 363 | - Changed loading of changelog tab 364 | - Fixed adding new folder 365 | - Added function to clear log 366 | 367 | ## v1.17.6.0 (2020-11-29) 368 | 369 | - Added Firefox Android Workarounds 370 | - Added function to save logfile 371 | - Fixed WebDAV clientname issue 372 | - Fixed adding new bookmark in special cases 373 | - Added confirmation dialog for export 374 | 375 | ## v1.17.5.6 (2020-10-19) 376 | 377 | - Added Firefox Android Workarounds 378 | 379 | ## v1.17.5.5 (2020-10-16) 380 | 381 | - Fixed building clientlist 382 | 383 | ## v1.17.5.4 (2020-10-09) 384 | 385 | - Removed more permissions 386 | - Extended error handler for internal errors 387 | - Add urls from notifications to logfile 388 | - Re-Added popup for push page 389 | 390 | ## v1.17.5 (2020-10-01) 391 | 392 | - Removed permissions 393 | - Removed popup 394 | - Added error handler for internal errors 395 | - Shorten date format 396 | - Fixed compare statement 397 | - Fixed submit on options 398 | 399 | ## v1.17.4 (2020-09-09) 400 | 401 | - Browser detection at server level 402 | 403 | ## v1.17.3 (2020-09-05) 404 | 405 | - Fix for edit bookmarks 406 | 407 | ## v1.17.2 (2020-09-04) 408 | 409 | - Fix for startup sync 410 | 411 | ## v1.17.1 (2020-09-03) 412 | 413 | - Fixed not appearing user conformations 414 | 415 | ## v1.17.0 (2020-09-02) 416 | 417 | - Fix Import bookmarks from options page 418 | - Re-create Options page to fit mobile 419 | - Remove buttons from popup window 420 | - Fixes for Mobile 421 | 422 | ## v1.16.4 (2020-08-30) 423 | 424 | - Fix for Mobile 425 | 426 | ## v1.16.3 (2020-08-26) 427 | 428 | - Fix for startup sync 429 | 430 | ## v1.16.2 (2020-08-16) 431 | 432 | - Fix for startup sync 433 | 434 | ## v1.16.1 (2020-08-15) 435 | 436 | - Fix popup import function 437 | - Fix popup export function 438 | 439 | ## v1.16.0 (2020-08-14) 440 | 441 | - Send pages directly to specific clients 442 | - Receive pages as notifications 443 | - Rename client 444 | - Small fixes 445 | 446 | ## v1.15.0 (2020-07-08) 447 | 448 | - Added function to push page and link to PHP backend 449 | 450 | ## v1.14.3 (2020-04-20) 451 | 452 | - Fix for warning in options page 453 | 454 | ## v1.14.2 (2020-04-18) 455 | 456 | - Fix for config check 457 | 458 | ## v1.14.1 (2020-04-16) 459 | 460 | - Better return-code when exporting bookmarks from browser 461 | - Dynamic browser detect 462 | 463 | ## v1.14.0 (2020-04-16) 464 | 465 | - Initial disable buttons in popup 466 | 467 | ## v1.13.2 (2020-03-27) 468 | 469 | - Replace wrong error message when remove successfully bookmark on server. 470 | 471 | ## v1.13.1 (2020-03-24) 472 | 473 | - Change by return code from export 474 | 475 | ## v1.13.0 (2019-01-13) 476 | 477 | - Fix accessing options and export from popup 478 | - Updating readme 479 | 480 | ## v1.12.0 (2019-01-04) 481 | 482 | - Added translation german 483 | - Rename to SyncMarks 484 | 485 | ## v1.11.3 (2018-12-27) 486 | 487 | - Changed Popup text 488 | - Fixed typo 489 | 490 | ## v1.11.0 (2018-12-18) 491 | 492 | - Redesign of options page 493 | - Moved startup sync message to popup 494 | 495 | ## v1.10.6 (2018-12-02) 496 | 497 | - Changed automatic logging 498 | 499 | ## v1.10.5 (2018-12-05) 500 | 501 | - Added logging function in options page 502 | 503 | ## v1.10.3 (2018-12-04) 504 | 505 | - Fix for startup sync 506 | - More detailed console messages 507 | 508 | ## v1.10.2 (2018-11-29) 509 | 510 | - Revert the change from 1.10.1 511 | - Fixed parameters for bookmark move 512 | 513 | ## v1.10.1 (2018-11-28) 514 | 515 | - Changed the Move bookmark process 516 | 517 | ## v1.10.0 (2018-11-26) 518 | 519 | - Added export function 520 | - Added import function 521 | - Changed move and edit function 522 | - Changed authentication 523 | 524 | ## v1.0.9 (2018-11-20) 525 | 526 | - Fixed url encoding problems 527 | - Fixed creating and removing of folders 528 | - Other small fixes 529 | 530 | ## v1.0.8 (2018-11-20) 531 | 532 | - Added support for PHP server side sync 533 | 534 | ## v1.0.6 (2018-07-06) 535 | 536 | - Fixed startup behavior 537 | 538 | ## v1.0.5 (2018-07-05) 539 | 540 | - Fixed error for manual import 541 | - Removed unused code fragments 542 | 543 | ## v1.0.4 (2018-07-05) 544 | 545 | - Added context menu buttons 546 | - Fixed error in options page 547 | - Fixed error for manual import 548 | 549 | ## v1.0.3 (2018-07-01) 550 | 551 | - Cleanup code 552 | - Added toolbar button 553 | 554 | ## v1.0.2 (2018-03-29) 555 | 556 | - Fixed typo in sync check 557 | 558 | ## v1.0.1 (2018-06-29) 559 | 560 | - Fix issues with first time sync 561 | 562 | ## v1.0.0 (2018-06-29) 563 | 564 | - Added bookmark validation routine 565 | - Better compatibility with Standard Sync 566 | 567 | ## v0.9.0 (2018-06-29) 568 | 569 | - Initial Release -------------------------------------------------------------------------------- /scripts/options.css: -------------------------------------------------------------------------------- 1 | body { 2 | box-sizing: border-box; 3 | background-color: #f9f9fb; 4 | margin: 0; 5 | padding: 0; 6 | overflow: hidden; 7 | } 8 | body, button, input, textarea { 9 | font-family: Segoe UI, sans-serif; 10 | font-size: 15px; 11 | } 12 | input, button { 13 | border-radius: 4px; 14 | border: 1px solid darkgray; 15 | outline: 0; 16 | } 17 | #wdurl { 18 | display: inline-block; 19 | width: calc(100% - 90px); 20 | } 21 | #blogin { 22 | width: 75px; 23 | min-height: 29px; 24 | } 25 | .btm { 26 | width: 50%; 27 | display: flow-root; 28 | } 29 | button#lgin { 30 | margin-top: .7em; 31 | margin-right: 0; 32 | } 33 | #crdialog input { 34 | width: 100%; 35 | box-sizing: border-box; 36 | margin-bottom: 1em; 37 | padding: 0.25em 0.4em; 38 | } 39 | #crdialog label { 40 | font-size: 0.75em; 41 | } 42 | #lgini { 43 | background-color: bisque; 44 | display: none; 45 | border-radius: .3em; 46 | padding: .3em .5em; 47 | border: 1px solid; 48 | border-color: burlywood; 49 | color: firebrick; 50 | font-size: .8em; 51 | } 52 | #ipinfo { 53 | background: burlywood; 54 | padding: 0.1em 0.3em; 55 | border-radius: .4em; 56 | } 57 | .iiinfo { 58 | display: block; 59 | text-overflow: ellipsis; 60 | overflow: hidden; 61 | white-space: nowrap; 62 | font-size: .95em; 63 | padding-top: .5em; 64 | } 65 | #lgind { 66 | margin-bottom: 10px; 67 | } 68 | #lginl { 69 | visibility: hidden; 70 | left: calc(50% + .2em); 71 | font-size: .9em; 72 | text-decoration: none; 73 | color: #fcffe2; 74 | cursor: pointer; 75 | z-index: 1; 76 | outline: 0; 77 | width: calc(100% - 90px); 78 | border-radius: .3em; 79 | border: thin solid #f44336; 80 | background-color: #ff9800; 81 | top: 3.3em; 82 | position: absolute; 83 | transform: translate(-50%, 0); 84 | box-shadow: 0px 0px 0px 1px #20123a0a, 0px 1px 2px 0px #2200330a, 0px 2px 1px -1px #0730721f, 0px 1px 6px 0px #0e0d1a1f; 85 | line-height: 1.3em; 86 | } 87 | #blogin.loading { 88 | background: repeating-linear-gradient(-45deg, #3498db 0 15px, #2980b9 0 20px) left/200% 100%; 89 | animation: i3 4s infinite linear; 90 | } 91 | @keyframes i3 { 92 | 100% {background-position:right} 93 | } 94 | #confinput { 95 | display: none; 96 | } 97 | fieldset { 98 | padding: 10px 30px !important; 99 | border: 1px solid transparent; 100 | } 101 | legend { 102 | background-color: #daeff7; 103 | padding: .1em .3em; 104 | color: #3498db; 105 | border-radius: .3em; 106 | font-size: .85em; 107 | text-align: left; 108 | border: thin solid; 109 | margin-left: -20px; 110 | border-color: #b1d3f4; 111 | } 112 | button { 113 | border-color: transparent; 114 | font-size: 14px; 115 | letter-spacing: 0.5px; 116 | min-height: 36px; 117 | width: 115px; 118 | margin: 5px; 119 | position: relative; 120 | display: inline-block; 121 | transition: all 0.3s; 122 | cursor: pointer; 123 | } 124 | button:hover:not(:disabled) { 125 | background-color: #2980b9; 126 | color: white; 127 | } 128 | button:disabled { 129 | cursor: no-drop; 130 | pointer-events:none; 131 | } 132 | input:hover { 133 | border-color: cornflowerblue; 134 | } 135 | .browser-style .tooltiptext { 136 | visibility: hidden; 137 | width: 200px; 138 | background-color: #fcffe2; 139 | color: #220033; 140 | text-align: center; 141 | padding: .4em; 142 | border-radius: 5px; 143 | position: absolute; 144 | z-index: 1; 145 | bottom: 125%; 146 | margin-left: -140px; 147 | opacity: 0; 148 | transition: opacity 0.3s; 149 | display: inline-block; 150 | box-shadow: 0px 0px 0px 1px #20123a0a, 0px 1px 2px 0px #2200330a, 0px 2px 1px -1px #0730721f, 0px 1px 6px 0px #0e0d1a1f; 151 | } 152 | .browser-style .tooltiptext::after { 153 | content: ""; 154 | position: absolute; 155 | top: 100%; 156 | left: 50%; 157 | margin-left: -5px; 158 | border-width: 5px; 159 | border-style: solid; 160 | border-color: #fcffe2 transparent transparent transparent; 161 | } 162 | .browser-style:hover .tooltiptext { 163 | visibility: visible; 164 | opacity: 1; 165 | } 166 | #clientn { 167 | visibility: collapse; 168 | } 169 | .clients { 170 | visibility: visible !important; 171 | } 172 | .modal { 173 | display: none; 174 | position: fixed; 175 | z-index: 1; 176 | left: 0; 177 | top: 0; 178 | width: 100%; 179 | height: 100%; 180 | overflow: auto; 181 | background-color: rgb(0,0,0); 182 | background-color: rgba(0,0,0,0.4); 183 | } 184 | .modal-content { 185 | background-color: #fefefe; 186 | margin: 5% auto; 187 | padding: 10px; 188 | border: 1px solid #888; 189 | width: 80%; 190 | } 191 | .close { 192 | color: #aaa; 193 | float: right; 194 | font-size: 28px; 195 | font-weight: bold; 196 | } 197 | .close:hover, 198 | .close:focus { 199 | color: black; 200 | text-decoration: none; 201 | cursor: pointer; 202 | } 203 | #logsave { 204 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='width:24px;height:24px' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z' /%3E%3C/svg%3E"); 205 | } 206 | #logclear { 207 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='width:24px;height:24px' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z' /%3E%3C/svg%3E"); 208 | } 209 | .wdurl { 210 | position: absolute; 211 | top: 25px; 212 | right: 85px; 213 | } 214 | #wdurl.valid { 215 | border-color: limegreen; 216 | background-color: honeydew; 217 | color: green; 218 | } 219 | #wdurl.invalid { 220 | border-color: orangered; 221 | background-color: bisque; 222 | color: red; 223 | } 224 | .wdurl.valid:after { 225 | content: '✓'; 226 | color: limegreen; 227 | } 228 | .wdurl.invalid:after { 229 | content: '×'; 230 | color: red; 231 | } 232 | .cframe { 233 | width: calc(100% - 30px); 234 | border: 0; 235 | height: calc(100% - 150px); 236 | position: absolute; 237 | } 238 | #toolbar > label { 239 | position: absolute; 240 | right: .5em; 241 | line-height: 2em; 242 | } 243 | #logarea { 244 | background: white; 245 | border: 1px solid gainsboro; 246 | overflow: hidden; 247 | max-width: 700px; 248 | width: 100%; 249 | margin-top: 38px; 250 | position: initial; 251 | height: calc(100% - 10px); 252 | } 253 | #logarea body { 254 | white-space: pre; 255 | font-family: consolas, courier; 256 | font-size: 0.9em; 257 | background: white; 258 | padding: 10px; 259 | overflow: auto; 260 | width: 100%; 261 | position: inherit; 262 | height: calc(100% - 30px); 263 | } 264 | h1 img { 265 | vertical-align: bottom; 266 | margin-right: 10px; 267 | margin-bottom: -5px; 268 | } 269 | .switch { 270 | position: relative; 271 | display: inline-block; 272 | width: 30px; 273 | height: 17px; 274 | white-space: nowrap; 275 | margin-top: 10px; 276 | cursor: pointer; 277 | } 278 | .switch:has(input[disabled]) { 279 | cursor: not-allowed; 280 | color: darkgray; 281 | } 282 | .switch:has(input[disabled]) .slider { 283 | background-color: gainsboro; 284 | } 285 | span.lbl { 286 | padding-left: 30px; 287 | margin-top: -1px; 288 | position: absolute; 289 | } 290 | .switch input { 291 | opacity: 0; 292 | width: 0; 293 | height: 0; 294 | } 295 | .slider { 296 | position: absolute; 297 | top: 0; 298 | left: 0; 299 | right: 0; 300 | bottom: 0; 301 | background-color: #ccc; 302 | -webkit-transition: .2s; 303 | transition: .2s; 304 | } 305 | .slider:before { 306 | position: absolute; 307 | content: ""; 308 | height: 13px; 309 | width: 13px; 310 | left: 2px; 311 | bottom: 2px; 312 | background-color: white; 313 | -webkit-transition: .2s; 314 | transition: .2s; 315 | } 316 | input:checked + .slider { 317 | background-color: #2196F3; 318 | } 319 | input:focus + .slider { 320 | box-shadow: 0 0 1px #2196F3; 321 | } 322 | input:checked + .slider:before { 323 | -webkit-transform: translateX(13px); 324 | -ms-transform: translateX(13px); 325 | transform: translateX(13px); 326 | } 327 | .slider.round { 328 | border-radius: 17px; 329 | } 330 | .slider.round:before { 331 | border-radius: 50%; 332 | } 333 | .modal { 334 | display: none; 335 | position: fixed; 336 | z-index: 1; 337 | left: 0; 338 | top: 0; 339 | width: 100%; 340 | height: 100%; 341 | overflow: auto; 342 | background-color: rgb(0,0,0); 343 | background-color: rgba(0,0,0,0.4); 344 | } 345 | button:not(:disabled) { 346 | background-color: #3498db; 347 | color: white; 348 | } 349 | .modal button { 350 | width: 44%; 351 | margin-left: 10px; 352 | margin-top: 20px; 353 | transition: all 0.3s; 354 | } 355 | .modal button:hover { 356 | background-color: #2980b9; 357 | color: white; 358 | } 359 | .modal-content { 360 | background-color: #fefefe; 361 | margin: 15% auto; 362 | padding: 20px; 363 | border: 1px solid #888; 364 | width: 80%; 365 | max-width: 350px; 366 | border-radius: 5px; 367 | box-shadow: 0.3em 0.3em 0.3em 0 rgb(0 0 0 / 35%); 368 | } 369 | .close { 370 | color: #aaa; 371 | float: right; 372 | font-size: 28px; 373 | font-weight: bold; 374 | position: relative; 375 | margin-top: -0.5em; 376 | margin-right: -0.4em; 377 | } 378 | .mtext { 379 | padding-top: 10px; 380 | position: relative; 381 | display: block; 382 | } 383 | .close:hover, .close:focus { 384 | color: black; 385 | text-decoration: none; 386 | cursor: pointer; 387 | } 388 | .ocontainer { 389 | display: block; 390 | text-align: center; 391 | background-color: white; 392 | margin: 15px; 393 | padding: 30px; 394 | box-shadow: 0 8px 12px 1px rgba(29, 17, 51, 0.04), 0 3px 16px 2px rgba(9, 32, 77, 0.12), 0 5px 10px -3px rgba(29, 17, 51, 0.12); 395 | border-radius: 8px; 396 | } 397 | .btnc .toptionc { 398 | display: contents; 399 | } 400 | .toptionc { 401 | position: relative; 402 | text-align: left; 403 | } 404 | #cimport { 405 | width: 100%; 406 | height: 32px; 407 | border-radius: 5px; 408 | outline: 0; 409 | margin-top: 10px; 410 | border: 1px solid darkgray; 411 | } 412 | #changelog { 413 | overflow: auto; 414 | position: absolute; 415 | right: 0px; 416 | left: 0px; 417 | top: 95px; 418 | bottom: 0px; 419 | padding: 5px 30px; 420 | font-family: Consolas, Courier, Monospace; 421 | } 422 | .tab-bar button { 423 | border-radius: 0; 424 | margin: 0; 425 | padding: 0; 426 | display: block; 427 | width: calc(100% / 3); 428 | float: left; 429 | min-height: unset; 430 | height: 25px; 431 | background-color: whitesmoke; 432 | color: unset; 433 | } 434 | .tab-bar button:hover { 435 | background-color: darkgrey; 436 | } 437 | .tab-button > span { 438 | overflow: hidden; 439 | text-overflow: ellipsis; 440 | white-space: nowrap; 441 | width: 100%; 442 | display: block; 443 | padding: 0 3px; 444 | } 445 | .abutton { 446 | background-color: DimGray !important; 447 | color: white !important; 448 | } 449 | .tab-bar { 450 | box-shadow: 0px 0px 0px 1px #20123a0a, 0px 1px 2px 0px #2200330a, 0px 2px 1px -1px #0730721f, 0px 1px 6px 0px #0e0d1a1f; 451 | margin-bottom: 10px; 452 | background-color: white; 453 | } 454 | h1 { 455 | margin-top: 0; 456 | padding: 5px 20px 0; 457 | font-size: 1.5em; 458 | white-space: nowrap; 459 | text-overflow: ellipsis; 460 | overflow: hidden; 461 | margin-bottom: 10px; 462 | } 463 | .otabs { 464 | padding: 0; 465 | max-width: 700px; 466 | width: 100%; 467 | height: calc(100% - 84px); 468 | position: absolute; 469 | top: 84px; 470 | z-index: 0; 471 | margin-left: auto; 472 | margin-right: auto; 473 | left: 0; 474 | right: 0; 475 | } 476 | .server .toptionc { 477 | display: block; 478 | white-space: nowrap; 479 | width: 100%; 480 | } 481 | .server .toptionc label { 482 | text-align: left; 483 | display: block; 484 | font-size: 0.75em; 485 | } 486 | .server .toptionc input { 487 | display: flex; 488 | width: calc(100% - .7em); 489 | padding: 0.25em 0.4em; 490 | } 491 | .server div { 492 | margin: 6px 0; 493 | } 494 | .exp_content { 495 | background-color: #f1f1f1; 496 | transition: max-height 0.2s ease-out; 497 | max-height: 0; 498 | overflow: hidden; 499 | border-bottom-left-radius: 4px; 500 | border-bottom-right-radius: 4px; 501 | margin-bottom: 10px; 502 | border: 1px solid transparent; 503 | border-top: 0; 504 | margin-left: 10px; 505 | width: calc(100% - 17px); 506 | } 507 | .exp_content.active { 508 | border: 1px solid dodgerblue; 509 | border-top: 0; 510 | } 511 | .collapsible { 512 | text-align: left; 513 | font-size: .8em; 514 | letter-spacing: unset; 515 | margin: unset; 516 | min-height: unset; 517 | width: calc(100% - 15px); 518 | margin-left: 10px; 519 | } 520 | .collapsible::after { 521 | content: '\002B'; 522 | float: right; 523 | } 524 | .collapsible.active::after { 525 | content: "\2212"; 526 | } 527 | .collapsible.active { 528 | background-color: dodgerblue; 529 | color: white; 530 | border-bottom-left-radius: 0; 531 | border-bottom-right-radius: 0; 532 | } 533 | .collapsible:hover { 534 | background-color: dimgray !important; 535 | } 536 | #wmessage { 537 | background-color: transparent; 538 | color: #555; 539 | text-align: center; 540 | padding: 10px 20px 30px 20px; 541 | position: absolute; 542 | z-index: 1; 543 | border: 0 solid; 544 | border-radius: 5px; 545 | margin: 0 auto; 546 | bottom: -80px; 547 | border-top: 0; 548 | border-bottom-left-radius: 0; 549 | border-bottom-right-radius: 0; 550 | box-shadow: 0px 0px 0px 1px #20123a0a, 0px 1px 2px 0px #2200330a, 0px 2px 1px -1px #0730721f, 0px 1px 6px 0px #0e0d1a1f; 551 | left: 0; 552 | right: 0; 553 | opacity: 0; 554 | transition: opacity 1s; 555 | } 556 | #wmessage.show { 557 | animation-name: bounceInUp; 558 | animation-duration: 1s; 559 | animation-fill-mode: both; 560 | bottom: -20px; 561 | opacity: 1; 562 | } 563 | @keyframes bounceInUp { 564 | 0%, 60%, 75%, 90%, 100% { 565 | transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 566 | } 567 | 0% { 568 | opacity: 0; 569 | transform: translate3d(0, 700px, 0); 570 | } 571 | 60% { 572 | opacity: 1; 573 | transform: translate3d(0, -20px, 0); 574 | } 575 | 75% { 576 | transform: translate3d(0, 5px, 0); 577 | } 578 | 90% { 579 | transform: translate3d(0, -5px, 0); 580 | } 581 | 100% { 582 | transform: translate3d(0, 0, 0); 583 | } 584 | } 585 | #wmessage.hide { 586 | animation-name: slideInDown; 587 | animation-duration: .5s; 588 | animation-fill-mode: both; 589 | } 590 | @keyframes slideInDown { 591 | 0% { 592 | transform: translateY(-70%); 593 | visibility: visible; 594 | } 595 | 100% { 596 | transform: translateY(0); 597 | } 598 | } 599 | #toolbar { 600 | background: gainsboro; 601 | position: absolute; 602 | left: 0px; 603 | right: -2px; 604 | top: 0; 605 | margin: 0; 606 | padding: 0 0 0 1px; 607 | border-bottom: 1px solid gainsboro; 608 | } 609 | #toolbar button { 610 | cursor: pointer; 611 | background-repeat: no-repeat; 612 | background-size: 24px; 613 | background-position: 5px; 614 | padding: 0 10px 0 30px; 615 | position: relative; 616 | line-height: 25px; 617 | min-height: 27px; 618 | } 619 | .btnc { 620 | display: flex; 621 | flex-flow: row wrap; 622 | } 623 | .btnc .bmarks { 624 | flex: 1; 625 | } 626 | .btnc fieldset { 627 | margin-top: 0px; 628 | } 629 | .btnc .sett { 630 | margin-left: 0; 631 | } 632 | @media all and (max-width: 560px) { 633 | .btnc .sett { 634 | width: 100%; 635 | margin-left: 15px !important; 636 | } 637 | } -------------------------------------------------------------------------------- /scripts/options.min.js: -------------------------------------------------------------------------------- 1 | function showMsg(e,t){let n=document.getElementById("wmessage");n.textContent=e,n.style.cssText="info"==t?"border-color: green; background-color: #98FB98;":"border-color: red; background-color: lightsalmon;",n.className="show",setTimeout(function(){n.className=n.className.replace("show","hide")},5e3)}function checkForm(){let e=document.getElementById("wdurl");e.classList.contains("valid")&&(document.getElementById("blogin").disabled=!1),chrome.permissions.getAll(function(t){t.permissions.includes("bookmarks")?""!=e.value?(document.getElementById("mdownload").disabled=!1,document.getElementById("mupload").disabled=!1):(document.getElementById("mdownload").disabled=!0,document.getElementById("mupload").disabled=!0):(showMsg(chrome.i18n.getMessage("optionsBAPIHint"),"info"),chrome.storage.local.set({sync:!1}),document.getElementById("mdownload").disabled=!0,document.getElementById("mupload").disabled=!0,document.getElementById("s_auto").checked=!1,document.getElementById("s_auto").disabled=!0)})}function checkLoginForm(){""!=document.getElementById("nuser").value&&""!=document.getElementById("npassword").value?document.getElementById("lgin").disabled=!1:document.getElementById("lgin").disabled=!0}function gToken(e){e.preventDefault(),document.getElementById("blogin").classList.add("loading"),document.getElementById("crdialog").style.display="none";const t={action:"clientCheck",client:document.getElementById("s_uuid").value,sync:document.getElementById("s_auto").checked},n=document.getElementById("wdurl").value,o=btoa(document.getElementById("nuser").value+":"+document.getElementById("npassword").value),s=new Headers;s.append("Content-Type","application/json;charset=UTF-8"),s.append("Authorization","Basic "+o);fetch(n+"?api=v1",{method:"POST",body:JSON.stringify(t),headers:s,redirect:"follow",referrerPolicy:"no-referrer"}).then(e=>e.json()).then(e=>{document.getElementById("blogin").classList.remove("loading");let t={sync:document.getElementById("s_auto").checked,name:document.getElementById("cname").value,uuid:document.getElementById("s_uuid").value,tabs:document.getElementById("s_tabs").checked,instance:document.getElementById("wdurl").value};t.token=e.token,chrome.storage.local.set(t),document.getElementById("blogin").removeAttribute("style"),chrome.action.setBadgeText({text:"i"}),chrome.action.setBadgeBackgroundColor({color:"chartreuse"}),chrome.action.setTitle({title:chrome.i18n.getMessage("extensionName")}),setTimeout(function(){chrome.action.setBadgeText({text:""})},5e3),document.getElementById("cname").defaultValue=e.cname,-1!==e.message.indexOf("updated")||-1!==e.message.indexOf("registered")?(wmessage.textContent=e.message,wmessage.style.cssText="border-color: green; background-color: #98FB98;",requestClientOptions(e.cOptions)):(wmessage.textContent="Warning: "+e.message,wmessage.style.cssText="border-color: red; background-color: lightsalmon;",chrome.runtime.sendMessage({action:"loglines",data:"Syncmarks Warning: "+e.message}))}).catch(e=>{switch(wmessage.style.cssText="border-color: red; background-color: lightsalmon;",chrome.runtime.sendMessage({action:"loglines",data:e}),response.status){case 404:wmessage.textContent=chrome.i18n.getMessage("optionsErrorURL")+e;break;case 401:wmessage.textContent=chrome.i18n.getMessage("optionsErrorUser")+e;break;default:wmessage.textContent=chrome.i18n.getMessage("optionsErrorLogin")+response.status+e}chrome.runtime.sendMessage({action:"loglines",data:"Syncmarks Error: "+wmessage.textContent})});wmessage.className="show",setTimeout(function(){wmessage.className=wmessage.className.replace("show","hide")},5e3)}function saveOptions(e){void 0!==e&&e.preventDefault();let t=chrome.i18n.getMessage("optionsSuccessSave"),n="info";("undefined"==typeof last_sync||last_sync.toString().length<=0)&&(t=chrome.i18n.getMessage("optionsNotUsed"),n="error");const o={sync:document.getElementById("s_auto").checked,name:document.getElementById("cname").value,uuid:document.getElementById("s_uuid").value,tabs:document.getElementById("s_tabs").checked,instance:document.getElementById("wdurl").value};chrome.storage.local.set(o),chrome.runtime.sendMessage({action:"clientSendOptions",data:o}),showMsg(t,n),chrome.runtime.sendMessage({action:"tabSync",data:o.tabs}),chrome.runtime.sendMessage({action:"bookmarkSync",data:o.sync})}function rName(){chrome.runtime.sendMessage({action:"clientRename",data:this.value})}function gName(){chrome.tabs.query({active:!0,currentWindow:!0},e=>{chrome.runtime.sendMessage({action:"clientInfo",tab:e[0].id})})}function uuidv4(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function restoreOptions(){chrome.tabs.query({active:!0,currentWindow:!0},e=>{chrome.runtime.sendMessage({action:"clientInfo",tab:e[0].id})});let e=document.getElementById("s_uuid"),t=document.getElementById("cname"),n=document.getElementById("wdurl"),o=document.getElementById("s_auto"),s=document.getElementById("s_tabs"),d=document.getElementById("blogin");chrome.storage.local.get(null,function(a){null==a.instance&&showMsg(chrome.i18n.getMessage("infoEmptyConfig"),"info"),n.defaultValue=a.instance||"",checkURL(),uuid=void 0===a.uuid?uuidv4():a.uuid,t.placeholder=uuid,e.defaultValue=uuid,o.defaultChecked=a.sync,gName(),void 0===a.token&&(d.disabled=!1,d.style.backgroundColor="red"),s.defaultChecked=null!=a.tabs&&a.tabs,last_sync=a.last_sync||0,last_sync.toString().length>0&&o.removeAttribute("disabled"),checkForm(),chrome.permissions.getAll(function(e){!1===e.permissions.includes("bookmarks")&&(o.disabled=!0,o.checked=!1),!1===e.permissions.includes("tabs")&&(s.disabled=!0,s.checked=!1)}),chrome.commands&&chrome.commands.getAll(e=>{for(let{name:t,shortcut:n}of e);})})}function manualImport(e){e.preventDefault(),"iyes"===this.id&&chrome.runtime.sendMessage({action:"removeAllMarks"});try{chrome.tabs.query({active:!0,currentWindow:!0},e=>{chrome.runtime.sendMessage({action:"bookmarkExport",data:"json",tab:e[0].id})})}catch(e){chrome.runtime.sendMessage({action:"loglines",data:e})}finally{document.getElementById("impdialog").style.display="none",chrome.storage.local.set({last_s:1})}}function manualExport(e){e.preventDefault();try{chrome.runtime.sendMessage({action:"exportPHPMarks"})}catch(e){chrome.runtime.sendMessage({action:"loglines",data:e})}finally{document.getElementById("expdialog").style.display="none",chrome.storage.local.set({last_s:1})}}function localizeHtmlPage(){for(var e=document.getElementsByTagName("span"),t=0;t2&&n.removeChild(n.childNodes[2]),"logfile"==e.target.dataset.val&&chrome.runtime.sendMessage({action:"getLoglines"});for(var o=0;o{const n=e?"Syncmarks: Access to "+t+" granted":"Syncmarks Warning: Access to "+t+" denied";chrome.runtime.sendMessage({action:"loglines",data:n}),checkURL()})}function requestClientOptions(e,t=!1){chrome.storage.local.get(null,function(n){void 0!==e&&e.length>0&&(select=document.getElementById("cimport"),select.length=0,e.forEach(e=>{var o=document.createElement("option");o.value=e.cOptions,o.innerText=e.cname,select.appendChild(o),n.uuid==e.cid&&(t=!0)}),t||(document.getElementById("coptionsdialog").style.display="block"))})}function serverImport(){const e=document.getElementById("s_uuid").value,t=document.getElementById("wdurl").value,n=document.getElementById("cimport"),o=JSON.parse(n.value);let s=n.options[n.selectedIndex].text;const d=o.uuid,a=btoa(document.getElementById("nuser").value+":"+document.getElementById("npassword").value);document.getElementById("cname").value=s!=o.name?s:o.name,document.getElementById("s_tabs").checked=o.tabs,document.getElementById("s_auto").checked=o.sync,document.getElementById("coptionsdialog").style.display="none",saveOptions(),setTimeout(()=>{if(confirm(chrome.i18n.getMessage("infoRestoreID"))){const n={action:"clientRemove",client:e,data:{new:e,old:d}};fetch(t+"?api=v1",{method:"POST",cache:"no-cache",headers:{"Content-type":"application/json;charset=UTF-8",Authorization:"Basic "+a},redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(n)}).then(e=>{let t=e.headers.get("X-Request-Info");return null!=t&&chrome.storage.local.set({token:t}),e.json()}).then(e=>{chrome.runtime.sendMessage({action:"loglines",data:"Info: Old client removed"})}).catch(e=>{chrome.runtime.sendMessage({action:"loglines",data:"Error: "+e})})}},500)}function checkURL(){let e=document.getElementById("wdurl");var t=new XMLHttpRequest;t.open("GET",e.value,!0),t.onreadystatechange=function(){4===t.readyState&&204===t.status?(e.classList.add("valid"),e.nextElementSibling.classList.add("valid"),e.classList.remove("invalid"),e.nextElementSibling.classList.remove("invalid"),document.getElementById("blogin").disabled=!1):(e.classList.add("invalid"),e.nextElementSibling.classList.add("invalid"),e.classList.remove("valid"),e.nextElementSibling.classList.remove("valid"),document.getElementById("blogin").disabled=!0)},t.setRequestHeader("X-Action","verify"),t.send(null)}chrome.runtime.onMessage.addListener(function(e,t,n){if(t.id===chrome.runtime.id)switch(e.task){case"clientInfo":document.getElementById("cname").title=e.cname?document.getElementById("s_uuid").value+" ("+e.ctype+")":document.getElementById("s_uuid").value,null!==e&&(document.getElementById("cname").defaultValue=e.cname==document.getElementById("s_uuid").value?"":e.cname);let t=document.getElementById("lgini"),n=document.getElementById("ipinfo");if(t.style.display="block",null!=e.cinfo){n.innerText=e.cinfo.ip;let t=document.createElement("span");t.className="iiinfo",t.id="iiinfo";let o=new Date(1e3*e.cinfo.tm).toLocaleString();t.innerText=o+"\n"+e.cinfo.de+" | "+e.cinfo.co+" | "+e.cinfo.ct+" | "+e.cinfo.re+"\n"+e.cinfo.ua,document.getElementById("iiinfo")&&document.getElementById("iiinfo").remove(),n.after(t)}break;case"bookmarkImport":showMsg(chrome.i18n.getMessage(e.text),"error"===e.type?"error":"info");break;case"bookmarkExport":case"clientRename":showMsg(e.text,"error"===e.type?"error":"info");break;case"rLoglines":rLoglines(e.text);break;case"clientOptions":requestClientOptions(e.cOptions,!1)}}),document.addEventListener("DOMContentLoaded",restoreOptions),window.addEventListener("load",function(){var e=new XMLHttpRequest;e.open("GET","../CHANGELOG.md",!0),e.responseType="text",e.onreadystatechange=function(){4===e.readyState&&(200!==e.status&&0!=e.status||(document.getElementById("changelog").innerText=e.responseText))},e.send(null);var t=document.getElementById("impdialog"),n=document.getElementById("expdialog"),o=document.getElementById("expimpdialog"),s=document.getElementById("coptionsdialog");localizeHtmlPage(),document.getElementById("version").textContent=chrome.runtime.getManifest().version,document.getElementById("econf").addEventListener("click",function(){o.style.display="block"}),document.getElementById("cclose").addEventListener("click",function(){o.style.display="none"}),document.getElementById("cimp").addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),o.style.display="none",chrome.runtime.sendMessage({action:"clientGetOptions"})}),document.getElementById("logdebug").addEventListener("change",filterLog),document.getElementById("iyes").addEventListener("click",manualImport),document.getElementById("eyes").addEventListener("click",manualExport),document.getElementById("ino").addEventListener("click",manualImport),document.getElementById("coimport").addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),serverImport()}),document.getElementById("cochancel").addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),s.style.display="none"}),document.getElementById("lchancel").addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),document.getElementById("crdialog").style.display="none"}),document.getElementById("imchancel").addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),document.getElementById("expimpdialog").style.display="none"}),document.getElementById("eno").addEventListener("click",function(){n.style.display="none"}),document.getElementById("iclose").addEventListener("click",function(){t.style.display="none"}),document.getElementById("eclose").addEventListener("click",function(){n.style.display="none"}),document.getElementById("oclose").addEventListener("click",function(){s.style.display="none"}),document.getElementById("crclose").addEventListener("click",function(){document.getElementById("crdialog").style.display="none"}),document.getElementById("mdownload").addEventListener("click",function(){t.style.display="block"}),document.getElementById("mupload").addEventListener("click",function(){n.style.display="block"}),document.getElementById("wdurl").addEventListener("blur",function(){requestHostPermission(),checkURL()}),document.getElementById("wdurl").addEventListener("change",checkForm),document.getElementById("blogin").addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),requestHostPermission(),document.getElementById("nuser").defaultValue="",document.getElementById("npassword").defaultValue="",document.getElementById("crdialog").style.display="block",document.getElementById("nuser").focus()}),document.getElementById("nuser").addEventListener("input",checkLoginForm),document.getElementById("npassword").addEventListener("input",checkLoginForm),document.getElementById("lgin").addEventListener("click",gToken),document.getElementById("s_tabs").addEventListener("change",saveOptions),document.getElementById("s_auto").addEventListener("change",saveOptions),document.getElementById("cname").addEventListener("change",rName),document.querySelectorAll(".tab-button").forEach(function(e){e.addEventListener("click",openTab)}),document.getElementById("logsave").addEventListener("click",saveLog),document.getElementById("logclear").addEventListener("click",clearLog),document.querySelector("h1").addEventListener("click",function(){window.open(document.getElementById("wdurl").value)}),window.onclick=function(e){e.target==t&&(t.style.display="none"),e.target==n&&(n.style.display="none")}}); -------------------------------------------------------------------------------- /scripts/background.min.js: -------------------------------------------------------------------------------- 1 | function sendRequest(e,t=null,o=null){chrome.storage.local.get(null,function(n){if(null==n.instance||n.instance.length<4)return!1;let r={client:n.uuid,token:n.token},s="Bearer "+btoa(encodeURIComponent(JSON.stringify(r))),a=n.uuid;"bookmarkAdd"===e.name&&!1===n.sync&&(a="bookmarkTab");const i={action:e.name,client:a,data:t};Object.keys(i).forEach(e=>null==i[e]&&delete i[e]),fetch(n.instance+"?api=v1",{method:"POST",cache:"no-cache",headers:{"Content-type":"application/json;charset=UTF-8",Authorization:s},redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(i)}).then(e=>{let t=e.headers.get("X-Request-Info");return null!=t&&(0==t?(chrome.storage.local.remove("token"),changeIcon("error"),chrome.storage.session.set({popup:{message:"Token removed",mode:"error"}})):chrome.storage.local.set({token:t})),e.json()}).then(t=>{e(t,o)}).catch(t=>{loglines=logit("Error: "+e+": "+t)})})}function clientSendOptions(e){200==e.code?(loglines=logit("Info: "+e.message),chrome.action.setBadgeText({text:""}),chrome.action.setBadgeBackgroundColor({color:"chartreuse"}),chrome.action.setTitle({title:chrome.i18n.getMessage("extensionName")}),changeIcon("info"),chrome.storage.session.set({popup:{message:e.message,mode:"success"}})):(changeIcon("warn"),chrome.storage.session.set({popup:{message:"clientSendOptions: "+e.message,mode:"warn"}}),loglines=logit("Error: "+e.message))}function clientGetOptions(e){chrome.runtime.sendMessage({task:"clientOptions",cOptions:e.cOptions})}function bmRemove(e){}function clientRemove(e){}function clientList(e){chrome.storage.local.remove("clist"),chrome.storage.local.set({clist:e.clients}),chrome.permissions.getAll(function(t){if(t.permissions.includes("contextMenus")&&Array.isArray(e.clients)){e.clients.forEach(function(e){var t=e.name?e.name:e.id;chrome.contextMenus.create({title:t,type:"normal",parentId:"ssendpage",contexts:["page"],id:"page_"+e.id}),chrome.contextMenus.create({title:t,type:"normal",parentId:"ssendlink",contexts:["link"],id:"link_"+e.id});try{chrome.contextMenus.create({title:t,type:"normal",parentId:"ssendtab",contexts:["tab"],id:"tab_"+e.id})}catch{}});let t=e.clients.length-1;loglines=logit("Info: List of "+t+" clients received successful.")}}),loglines=logit("Info: Get notifications for current client."),sendRequest(pushGet)}function pushURL(e){e.error&&(loglines=logit("Error: "+e.error))}function pushGet(e){if(Array.isArray(e.notifications)){try{e.notifications.forEach(function(e){loglines=logit('Info: Received tab: '+e.url+""),openTab(e.url,e.nkey,e.title)})}catch(e){loglines=logit("pushGet: "+e)}loglines=logit("Info: List of "+e.notifications.length+" notifications received successful.")}sendRequest(clientInfo)}function clientInfo(e,t=null){null!==e&&(lastseen=e.lastseen,null!=t?chrome.runtime.sendMessage({task:clientInfo.name,type:"success",cname:e.cname,ctype:e.ctype,cinfo:e.cinfo}):chrome.storage.local.get(null,async function(e){let t=e.sync||!1;t&&doFullSync()}))}function bookmarkExport(e,t=null){let o=e.bookmarks;const n=[];!1===mozilla&&(o=c2cm(o)),count=0,loglines=logit("Info: "+o.length+" Bookmarks received from server"),n.text=o.length+" Bookmarks received from server",n.type="success",n.task=bookmarkExport.name,importFull(o);let r=new Date(Date.now()),s={weekday:"short",hour:"2-digit",minute:"2-digit"};chrome.action.setTitle({title:chrome.i18n.getMessage("extensionName")+": "+r.toLocaleDateString(void 0,s)}),null!=t&&chrome.runtime.sendMessage({task:n.task,type:n.type,text:n.text}),loglines=logit("Info: Import finished")}function bookmarkImport(e){const t=[];200==e.code?(loglines=logit("Info: "+e.message),t.text="successExportBookmarks",t.type="success"):(loglines=logit("Error: bookmarkImport: "+e.message),t.text=chrome.i18n.getMessage("errorExportBookmarks"),t.type="error"),chrome.runtime.sendMessage({task:bookmarkImport.name,type:t.type,text:t.text})}function bookmarkAdd(e){let t="",o="";chrome.storage.local.get(null,async function(n){!1===n.sync&&(200===e.code?(t="Bookmark added",changeIcon("info"),mode="0",o="Info"):(t=e.message,changeIcon("warn"),chrome.storage.session.set({popup:{message:"bookmarkAdd: "+e.message,mode:"warn"}}),mode="1",o="Error"),200!==e.code&¬ify(Math.random().toString(16).substring(2,10),t),loglines=logit(o+": "+t))});let n=Date.now();chrome.storage.local.set({last_s:n})}function pushHide(e){e.error&&(loglines=logit("Error: pushHide: "+e.error))}function bookmarkEdit(e){200==e.code?loglines=logit("Info: Bookmark edited successfully at the server"):(message="Error: Bookmark not edited at the server, please check the server logfile.",loglines=logit(message),notify("error",message))}function bookmarkMove(e){loglines=200==e.code?logit("Info: Bookmark moved successfully at the server"):logit("Error: Bookmark not moved on server. "+e.message)}function bookmarkDel(e){switch(e.code){case 200:loglines=logit("Info: "+e.message);break;case 204:changeIcon("warn"),loglines=logit("Warn: "+ +e.message),chrome.storage.session.set({popup:{message:"bookmarkDel: "+e.message,mode:"warn"}});default:changeIcon("error"),loglines=logit("Error: bookmarkDel: "+ +e.message),chrome.storage.session.set({popup:{message:"bookmarkDel: "+e.message,mode:"error"}})}let t=Date.now();chrome.storage.local.set({last_s:t})}function clientRename(e){const t=[];e.message?(loglines=logit("Error: "+e.message),t.type="error",t.text=e.message):(t.type="success",t.text="Client renamed",changeIcon("info")),chrome.runtime.sendMessage({task:clientRename.name,type:t.type,text:""+t.text})}function tabsSend(e){if(parseInt(e.tabs)<1){let e="Tabs could not be saved, please check server error log";loglines=logit(e),changeIcon("error")}}function tabsGet(e){for(let t=0;t{chrome.tabs.query({},saveTabs)},3e3)}function tabUpdated(e,t){"complete"===t.status&&tabCreated(e)}function saveTabs(e){var t=[];e.forEach(function(e){void 0!==e.url&&!1===e.pinned&&!1===e.incognito&&e.url.startsWith("http")&&t.push({windowId:e.windowId,url:e.url,title:e.title})}),sendRequest(tabsSend,t)}function ccMenus(){chrome.permissions.getAll(function(e){e.permissions.includes("contextMenus")&&(chrome.contextMenus.removeAll(),chrome.storage.local.get(null,function(e){!1===e.sync&&chrome.commands.getAll(e=>{for(let{name:o,shortcut:n}of e)var t="bookmark-tab"===o?n:"undef";chrome.contextMenus.create({title:chrome.i18n.getMessage("bookmarkTab")+` (${t})`,type:"normal",contexts:["page"],id:"smark"})});try{chrome.contextMenus.create({title:chrome.i18n.getMessage("sendPage"),type:"normal",contexts:["page"],id:"ssendpage"}),chrome.contextMenus.create({title:chrome.i18n.getMessage("sendLink"),type:"normal",contexts:["link"],id:"ssendlink"});try{chrome.contextMenus.create({title:chrome.i18n.getMessage("sendTab"),type:"normal",contexts:["tab"],id:"ssendtab"})}catch{}}catch(e){loglines=logit("ccMenus: "+e)}})),chrome.storage.local.get(null,function(e){!0===e.tabs&&getNewTabs()})})}function bookmarkTab(){chrome.tabs.query({active:!0,currentWindow:!0},function(e){let t=JSON.stringify({id:Math.random().toString(24).substring(2,12),url:e[0].url,title:e[0].title,type:"bookmark",folder:!0===mozilla?"unfiled_____":2,nfolder:"More Bookmarks",added:(new Date).valueOf()});sendRequest(bookmarkAdd,t)})}function sendTab(e){chrome.tabs.query({active:!0,currentWindow:!0},function(t){chrome.storage.local.get(null,function(o){const n={url:e.target.url?e.target.url:t[0].url,target:e.target.id};loglines=logit("Info: "+chrome.i18n.getMessage("sendLinkYes")+", Client: "+o.uuid),sendRequest(pushURL,n)})})}function logit(e){const t=new Date;let o=t.toLocaleDateString("sv")+" "+t.toLocaleTimeString("sv");e.toString().toLowerCase().indexOf("undefined")>=0&&(e=(new Error).stack.toString());let n=loglines+o+" - "+e+"\n";return e.toString().toLowerCase().indexOf("error")>=0&&!1===e.toString().toLowerCase().indexOf("typeerror")&&(changeIcon("error"),chrome.storage.session.set({popup:{message:e,mode:"error"}})),n}function get_oMarks(){chrome.permissions.getAll(function(e){e.permissions.includes("bookmarks")&&chrome.bookmarks.getTree(function(e){oMarks=e})})}function removeAllMarks(){loglines=logit("Info: Try to remove all local bookmarks");try{chrome.bookmarks.onRemoved.removeListener(onRemovedCheck),chrome.bookmarks.getTree(function(e){e[0].children.forEach(function(e){e.children.forEach(function(e){chrome.bookmarks.onRemoved.removeListener(onRemovedCheck),chrome.bookmarks.removeTree(e.id)})})}),chrome.bookmarks.onRemoved.addListener(onRemovedCheck)}catch(e){loglines=logit(e)}finally{chrome.storage.local.set({last_s:1})}}function changeIcon(e){switch(e){case"error":chrome.action.setBadgeText({text:"!"}),chrome.action.setBadgeBackgroundColor({color:"red"});break;case"warn":chrome.action.setBadgeText({text:"!"}),chrome.action.setBadgeBackgroundColor({color:"gold"}),setTimeout(function(){chrome.action.setBadgeText({text:""})},5e3);break;case"info":chrome.action.setBadgeText({text:"i"}),chrome.action.setBadgeBackgroundColor({color:"chartreuse"}),chrome.action.setTitle({title:chrome.i18n.getMessage("extensionName")}),setTimeout(function(){chrome.action.setBadgeText({text:""})},5e3);break;default:statement(s)}}function init(){loglines=logit("Info: AddOn: "+chrome.runtime.getManifest().version),loglines=logit("Info: Browser: "+navigator.userAgent),chrome.runtime.getPlatformInfo(function(e){loglines=logit("Info: Architecture: "+e.arch+" | OS: "+e.os)}),get_oMarks(),chrome.storage.local.set({last_message:""}),chrome.storage.local.get(null,async function(e){if(null==e.instance)return changeIcon("error"),chrome.storage.session.set({popup:{message:"Instance undefined",mode:"error"}}),loglines=logit("Error: Instance undefined"),!1;void 0===e.token?(changeIcon("error"),chrome.storage.session.set({popup:{message:"Login token missing",mode:"error"}}),loglines=logit("Error: Login token missing")):chrome.action.setBadgeText({text:""}),e.instance&&(await ccMenus(),getPopupData(),loglines=logit("Info: Get list of clients."),sendRequest(clientList),loglines=logit("Info: Init finished"))})}function getPopupData(){chrome.storage.local.get(null,async function(e){const t=chrome.storage.session.get("bmhtml");let o="Bearer "+btoa(encodeURIComponent(JSON.stringify({client:e.uuid,token:e.token})));void 0===t.bmhtml&&(loglines=logit("Info: Get data for PopUp"),fetch(e.instance+"?t="+Math.random().toString(24).substring(2,12),{method:"GET",cache:"no-cache",referrerPolicy:"no-referrer",headers:{Authorization:o}}).then(e=>{let t=e.headers.get("X-Request-Info");return null!=t&&chrome.storage.local.set({token:t}),e.text()}).then(e=>{chrome.storage.session.set({bmhtml:e}),loglines=logit("Info: PopUp data saved in session storage"),changeIcon("info")}).catch(e=>{console.error(e),changeIcon("error")}))})}function onTabActivated(e){pTabs.forEach(async function(t,o){t.tID==e.tabId&&(sendRequest(pushHide,t.nID),pTabs.splice(o,1))})}function pTabsLoad(e,t){var o={tID:e,nID:Number(t)};chrome.storage.local.get(["pTabs"],function(e){pTabs.length=0,void 0!==e.pTabs&&e.pTabs.forEach(function(e){pTabs.push(e)}),pTabs.push(o),pTabsSave(pTabs)})}function pTabsSave(e){chrome.storage.local.set({pTabs:e})}function openTab(e,t,o){chrome.tabs.query({url:e},function(n){n.length<1?chrome.tabs.create({url:e,active:!1},function(e){pTabsLoad(e.id,t)}):pTabsLoad(n[0].id,t);let r=JSON.stringify({id:t,url:e});notify(r,e,o)})}function notificationSettings(e){let t=0===e.indexOf('{"id":')?"url":e.substring(0,e.indexOf("_")),o=["console","error","setting"];if(o.includes(t))debug=!0,chrome.runtime.openOptionsPage();else{let t;try{t=JSON.parse(e.substring(0,e.indexOf("_")))}catch(e){loglines=logit(e)}if(void 0!==t)try{chrome.tabs.query({url:t.url},function(e){e.length>0&&chrome.tabs.highlight({tabs:e[0].index})})}catch(e){loglines=logit(e)}}}function onInstalled(e){"install"==e.reason&&(chrome.runtime.openOptionsPage(),checkCommandShortcuts()),"update"==e.reason&&migrateOptions()}function migrateOptions(){chrome.storage.local.get(null,function(e){null!=e.wdurl&&chrome.storage.local.set({sync:e.actions.startup,uuid:e.s_uuid,tabs:e.s_tabs,instance:e.wdurl}),null!=e.sync&&null!=e.sync.auto&&chrome.storage.local.set({sync:e.sync.auto})})}function checkCommandShortcuts(){chrome.commands.getAll(e=>{let t=[];for(let{name:o,shortcut:n}of e)""===n&&t.push(o);t.length>0&¬ify("error","Default Shortcuts for Extension (Ctrl+Q) could not be set. Please check your settings, if they are blocked by another extension. You can set your own Shortcut in Browser settings.")})}function notify(e,t,o=chrome.i18n.getMessage("extensionName")){e=e+"_"+Date.now().toString();try{chrome.notifications.create(e,{type:"basic",title:o,iconUrl:"/icons/bookmark.png",message:t})}catch(e){loglines=logit(e)}}function onCreatedCheck(e,t){get_oMarks(),chrome.storage.local.get(null,function(e){var o=e.sync||!1;o&&sendMark(t)})}function onMovedCheck(e,t){get_oMarks(),chrome.storage.local.get(null,async function(o){var n=o.sync||!1;n&&chrome.bookmarks.get(t.parentId,function(o){chrome.bookmarks.get(e,function(n){let r={id:e,index:t.index,folderIndex:o[0].index,folder:t.parentId,nfolder:o[0].title,url:n[0].url,title:n[0].title};loglines=logit("Info: Sending move request to server. Bookmark ID: "+e),sendRequest(bookmarkMove,r)})})})}function onChangedCheck(e,t){get_oMarks(),chrome.storage.local.get(null,function(o){var n=o.sync||!1;n&&chrome.bookmarks.get(e,function(e){let o={url:e[0].url,title:e[0].title,parentId:e[0].parentId,index:e[0].index};loglines=logit("Info: Sending edit request to server. URL: "+t.url),sendRequest(bookmarkEdit,o)})})}function onRemovedCheck(e,t){chrome.storage.local.get(null,async function(e){var o=e.sync||!1;o&&(await removeMark(t),await get_oMarks())})}function exportPHPMarks(e=[]){loglines=logit("Info: Send new local bookmarks to server");let t="",o=0;chrome.bookmarks.getTree(function(n){0===e.length?(t=n,o=0):(t=e,o=1),sendRequest(bookmarkImport,t)});let n=Date.now();chrome.storage.local.set({last_s:n})}function removeMark(e){chrome.bookmarks.get(e.parentId,async function(t){let o={url:e.node.url,folder:e.parentId,nfolder:t[0].title,index:e.index,type:e.node.type,id:e.node.id,title:e.node.title};loglines=logit("Info: Sending remove request to server: "+e.node.url+""),sendRequest(bookmarkDel,o)})}function sendMark(e){"type"in e||"url"in e?!("type"in e)&&"url"in e&&(e.type="bookmark"):e.type="folder",chrome.bookmarks.get(e.parentId,async function(t){let o={id:e.id,url:e.url,title:e.title,type:e.type,folder:e.parentId,nfolder:t[0].title,added:e.dateAdded};loglines=logit("Info: Sending add request to server: "+e.url+""),sendRequest(bookmarkAdd,o)})}async function doFullSync(){loglines=logit("Info: Start Sync");try{chrome.storage.local.get(null,async function(e){loglines=logit("Info: Sending Sync request to server"),sendRequest(bookmarkExport,"json")})}catch(e){loglines=logit("doFullSync: "+e)}finally{chrome.storage.local.set({last_s:1})}}async function importFull(e){function t(e){e.forEach(function(e){s.push(e),e.children&&t(e.children)})}async function o(t,o){let n=0,r=(await searchBookmarkAsync({title:t.bmTitle}))[0];if(void 0===r)n=1;else{let o=e.filter(e=>e.bmID===t.bmParentID)[0].bmTitle,s=(await getBookmarkAsync(r.parentId))[0].title;n=o!==s?2:3}return n}async function n(t){let o="",n="";if(t.bmParentID.endsWith("_____")||1===t.bmParentID.length)n=t.bmParentID;else{let r=t.bmParentID;o=null!=e.filter(e=>e.bmID==r)[0]?e.filter(e=>e.bmID==r)[0].bmTitle:"";let s=await searchBookmarkAsync({title:o});if(!(s.length>0))return!1;n=s[0].id}let r={};mozilla?(r.index=parseInt(t.bmIndex),r.parentId=n,r.title=t.bmTitle,r.url=t.bmURL,r.type=t.bmType):(r.parentId=n,r.title=t.bmTitle,r.url=t.bmURL);let s=await createBookmarkAsync(r),a=s;if(a&&void 0===typeof a.url){let o=t.bmID,n=a.id;e.forEach(async function(t,r){e[r].bmParentID===o&&(e[r].bmParentID=n),e[r].bmID===o&&(e[r].bmID=n)})}}async function r(t){let o=(await searchBookmarkAsync({title:t.bmTitle}))[0],n="",r="";if(t.bmParentID.endsWith("_____")||1===t.bmParentID.length)r=t.bmParentID;else{let o=t.bmParentID;n=e.filter(e=>e.bmID==o)[0].bmTitle;let s=await searchBookmarkAsync({title:n});if(0==s.length)return!1;r=(await searchBookmarkAsync({title:n}))[0].id}let s=new Object;s.parentId=r,"bmIndex"in t&&(s.index=parseInt(t.bmIndex));await moveBookmarkAsync(o.id,s)}loglines=logit("Info: Starting import");const s=[],a=new Array,i=new Array;t(oMarks),s.forEach(function(t){const o=e.some(e=>e.bmTitle===t.title);o||a.push(t)}),bookmarkSync(!1);for(let t=0;t1?await o(remoteMark,t):0,s){case 0:loglines=logit('Debug: Ignore bookmark "'+remoteMark.bmTitle+'"');break;case 1:loglines=logit('Debug: Create bookmark "'+remoteMark.bmTitle+'"'),await n(remoteMark);break;case 2:loglines=logit('Debug: Move bookmark "'+remoteMark.bmTitle+'"'),await r(remoteMark);break;case 3:loglines=logit('Debug: Existing Bookmark "'+remoteMark.bmTitle+'"'),await r(remoteMark);break;default:loglines=logit('Debug: Unknown action for bookmark "'+remoteMark.bmTitle+'"')}}let c=0==lastseen?Date.now():lastseen;a.forEach(e=>{e.id.endsWith("_____")||e.id.length<2||(e.dateAdded>=c?i.push(e):(chrome.bookmarks.onRemoved.removeListener(onRemovedCheck),chrome.bookmarks.remove(e.id,function(e){})))}),bookmarkSync(!0),i.length>0&&exportPHPMarks(i)}function c2cm(e){return e.forEach(e=>{"root________"==e.bmID&&(e.bmID="0"),"root________"==e.bmParentID&&(e.bmParentID="0"),"toolbar_____"==e.bmID&&(e.bmID="1"),"toolbar_____"==e.bmParentID&&(e.bmParentID="1"),"unfiled_____"==e.bmID&&(e.bmID="2"),"unfiled_____"==e.bmParentID&&(e.bmParentID="2"),"mobile______"==e.bmID&&(e.bmID="3"),"mobile______"==e.bmParentID&&(e.bmParentID="3"),"menu________"==e.bmID&&(e.bmID="2"),"menu________"==e.bmParentID&&(e.bmParentID="2")}),e}function getBookmarkAsync(e){return new Promise(function(t,o){chrome.bookmarks.get(e,t)})}function searchBookmarkAsync(e){return new Promise(function(t,o){chrome.bookmarks.search(e,t)})}function createBookmarkAsync(e){return new Promise(function(t,o){chrome.bookmarks.create(e,t)})}function moveBookmarkAsync(e,t){return new Promise(function(o,n){chrome.bookmarks.move(e,t,o)})}function importMarks(e,t=0){let o=e[t].bmID,n=e[t].bmParentID,r=parseInt(e[t].bmIndex,10),s=e[t].bmTitle,a=e[t].bmType,i=e[t].bmURL;if(!0===mozilla){var c=void 0!==n&&"__"==n.substr(n.length-2)?n:dictOldIDsToNewIDs[n];if("root________"==n)return importMarks(e,++t),!1}else{c=void 0!==n&&n.length<2?n:dictOldIDsToNewIDs[n];if("0"==n)return importMarks(e,++t),!1}bookmarkSync(!1),!0===mozilla?chrome.bookmarks.create("folder"==a?{index:r,parentId:c,title:s,type:a}:{index:r,parentId:c,title:s,type:a,url:i},function(n){let r="__"==o.substr(o.length-2)?o:n.id;dictOldIDsToNewIDs[o]=r,++count,void 0===e[t+1]?(message=count+chrome.i18n.getMessage("successImportBookmarks"),notify("info",message),loglines=logit("Info: "+message+" Re-adding the listeners now"),bookmarkSync(!1)):importMarks(e,++t)}):o.length>1&&chrome.bookmarks.create("folder"==a?{index:r,parentId:c,title:s}:{parentId:c,title:s,url:i},function(n){let r=e.length,s=t+1;if(s{init()}),mozilla){setInterval(()=>{chrome.runtime.getPlatformInfo,self.postMessage("keep")},2e4)}else{setInterval(()=>{chrome.runtime.getPlatformInfo,self.serviceWorker.postMessage("keep")},2e4)}chrome.runtime.onMessage.addListener(function(e,t,o){if(t.id===chrome.runtime.id)switch(e.action){case"clientInfo":sendRequest(clientInfo,e.data,e.tab);break;case"clientRename":sendRequest(clientRename,e.data);break;case"clientSendOptions":sendRequest(clientSendOptions,e.data);break;case"clientGetOptions":sendRequest(clientGetOptions);break;case"clientRemove":sendRequest(clientRemove,e.data);break;case"removeAllMarks":removeAllMarks();break;case"bookmarkExport":sendRequest(bookmarkExport,e.data,e.tab);break;case"exportPHPMarks":exportPHPMarks();break;case"loglines":console.log(e.data),loglines=logit(e.data);break;case"getLoglines":0===loglines.length&&(loglines=logit("Info: No Log entry available")),chrome.runtime.sendMessage({task:"rLoglines",text:loglines});break;case"emptyLoglines":loglines="",chrome.runtime.sendMessage({task:"rLoglines",text:loglines});break;case"changeIcon":changeIcon(e.data);break;case"bookmarkTab":bookmarkTab();break;case"tabSync":tabSync(e.data);break;case"bmRemove":sendRequest(bmRemove,e.data);break;case"puData":getPopupData();break;default:return!1}}),chrome.permissions.getAll(function(e){chrome.storage.local.get(null,function(e){chrome.bookmarks&&bookmarkSync(e.sync),tabSync(e.tabs)}),e.permissions.includes("contextMenus")&&chrome.contextMenus.onClicked.addListener(function(e){if((e.menuItemId.includes("page_")||e.menuItemId.includes("tab_"))&&chrome.tabs.query({active:!0,currentWindow:!0},function(t){let o={target:{id:e.menuItemId.substring(5),url:t[0].url}};sendTab(o)}),e.menuItemId.includes("link_")){let t={target:{id:e.menuItemId.substring(5),url:e.linkUrl}};sendTab(t)}})}),chrome.runtime.onInstalled.addListener(onInstalled),chrome.notifications.onClicked.addListener(notificationSettings),chrome.tabs.onActivated.addListener(onTabActivated),void 0!==chrome.commands&&chrome.commands.onCommand.addListener(e=>{bookmarkTab()}); -------------------------------------------------------------------------------- /scripts/options.js: -------------------------------------------------------------------------------- 1 | chrome.runtime.onMessage.addListener( 2 | function(message, sender, sendResponse) { 3 | if(sender.id === chrome.runtime.id) { 4 | switch (message.task) { 5 | case 'clientInfo': 6 | document.getElementById("cname").title = (message.cname) ? document.getElementById('s_uuid').value + " (" + message.ctype + ")":document.getElementById('s_uuid').value; 7 | if(message !== null) document.getElementById("cname").defaultValue = (message.cname == document.getElementById('s_uuid').value) ? '':message.cname; 8 | let iBox = document.getElementById("lgini"); 9 | let ip = document.getElementById('ipinfo'); 10 | iBox.style.display = 'block'; 11 | if(message.cinfo != undefined) { 12 | ip.innerText = message.cinfo.ip; 13 | let ipinfo = document.createElement('span'); 14 | ipinfo.className = "iiinfo"; 15 | ipinfo.id = "iiinfo"; 16 | let tm = new Date(message.cinfo.tm * 1000).toLocaleString(); 17 | ipinfo.innerText = tm + '\n' + message.cinfo.de + ' | ' + message.cinfo.co + ' | ' + message.cinfo.ct + ' | ' + message.cinfo.re + '\n' + message.cinfo.ua; 18 | if(document.getElementById('iiinfo')) document.getElementById('iiinfo').remove(); 19 | ip.after(ipinfo); 20 | } 21 | break; 22 | case 'bookmarkImport': 23 | showMsg(chrome.i18n.getMessage(message.text), (message.type === 'error') ? 'error':'info'); 24 | break; 25 | case 'bookmarkExport': 26 | showMsg(message.text, (message.type === 'error') ? 'error':'info'); 27 | break; 28 | case 'clientRename': 29 | showMsg(message.text, (message.type === 'error') ? 'error':'info'); 30 | break; 31 | case 'rLoglines': 32 | rLoglines(message.text); 33 | break; 34 | case 'clientOptions': 35 | requestClientOptions(message.cOptions, false); 36 | break; 37 | default: 38 | break; 39 | } 40 | } 41 | } 42 | ); 43 | 44 | function showMsg(text, type) { 45 | let wmessage = document.getElementById('wmessage'); 46 | wmessage.textContent = text; 47 | wmessage.style.cssText = (type == 'info') ? "border-color: green; background-color: #98FB98;":"border-color: red; background-color: lightsalmon;"; 48 | wmessage.className = "show"; 49 | setTimeout(function(){wmessage.className = wmessage.className.replace("show", "hide"); }, 5000); 50 | } 51 | 52 | function checkForm() { 53 | let url = document.getElementById('wdurl'); 54 | if(url.classList.contains('valid')) { 55 | document.getElementById('blogin').disabled = false; 56 | } 57 | 58 | chrome.permissions.getAll(function(e) { 59 | if(e.permissions.includes('bookmarks')) { 60 | if(url.value != ''){ 61 | document.getElementById('mdownload').disabled=false; 62 | document.getElementById('mupload').disabled=false; 63 | } else{ 64 | document.getElementById('mdownload').disabled=true; 65 | document.getElementById('mupload').disabled=true; 66 | } 67 | } else { 68 | showMsg(chrome.i18n.getMessage("optionsBAPIHint"), 'info'); 69 | chrome.storage.local.set({sync: false}); 70 | document.getElementById('mdownload').disabled=true; 71 | document.getElementById('mupload').disabled=true; 72 | document.getElementById('s_auto').checked = false; 73 | document.getElementById('s_auto').disabled = true; 74 | } 75 | }); 76 | } 77 | 78 | function checkLoginForm() { 79 | if(document.getElementById('nuser').value != '' && document.getElementById('npassword').value != '' ) { 80 | document.getElementById('lgin').disabled = false; 81 | } else { 82 | document.getElementById('lgin').disabled = true; 83 | } 84 | } 85 | 86 | function gToken(e) { 87 | e.preventDefault(); 88 | document.getElementById('blogin').classList.add('loading'); 89 | document.getElementById('crdialog').style.display = "none"; 90 | 91 | const params = { 92 | action: "clientCheck", 93 | client: document.getElementById('s_uuid').value, 94 | sync: document.getElementById('s_auto').checked 95 | }; 96 | 97 | const url = document.getElementById('wdurl').value; 98 | const creds = btoa(document.getElementById('nuser').value + ':' + document.getElementById('npassword').value); 99 | const headers = new Headers(); 100 | headers.append("Content-Type", "application/json;charset=UTF-8"); 101 | headers.append("Authorization", 'Basic ' + creds); 102 | 103 | const myRequest = fetch(url + '?api=v1', { 104 | method: "POST", 105 | body: JSON.stringify(params), 106 | headers: headers, 107 | redirect: 'follow', 108 | referrerPolicy: 'no-referrer', 109 | }).then(response => response.json()).then(responseData => { 110 | document.getElementById('blogin').classList.remove('loading'); 111 | 112 | let cOptions = { 113 | sync: document.getElementById("s_auto").checked, 114 | name: document.getElementById("cname").value, 115 | uuid: document.getElementById("s_uuid").value, 116 | tabs: document.getElementById("s_tabs").checked, 117 | instance: document.getElementById("wdurl").value 118 | }; 119 | 120 | cOptions.token = responseData.token; 121 | 122 | chrome.storage.local.set(cOptions); 123 | document.getElementById('blogin').removeAttribute('style') 124 | chrome.action.setBadgeText({text: 'i'}); 125 | chrome.action.setBadgeBackgroundColor({color: "chartreuse"}); 126 | chrome.action.setTitle({title: chrome.i18n.getMessage("extensionName")}); 127 | setTimeout(function(){ 128 | chrome.action.setBadgeText({text: ''}); 129 | }, 5000); 130 | 131 | document.getElementById('cname').defaultValue = responseData.cname; 132 | 133 | if(responseData.message.indexOf('updated') !== -1 || responseData.message.indexOf('registered') !== -1) { 134 | wmessage.textContent = responseData.message; 135 | wmessage.style.cssText = "border-color: green; background-color: #98FB98;"; 136 | requestClientOptions(responseData.cOptions); 137 | } else { 138 | wmessage.textContent = 'Warning: '+ responseData.message; 139 | wmessage.style.cssText = "border-color: red; background-color: lightsalmon;"; 140 | chrome.runtime.sendMessage({action: "loglines", data: 'Syncmarks Warning: '+ responseData.message}); 141 | } 142 | }).catch(err => { 143 | wmessage.style.cssText = "border-color: red; background-color: lightsalmon;"; 144 | chrome.runtime.sendMessage({action: "loglines", data: err}); 145 | switch(response.status) { 146 | case 404: wmessage.textContent = chrome.i18n.getMessage("optionsErrorURL") + err; 147 | break; 148 | case 401: wmessage.textContent = chrome.i18n.getMessage("optionsErrorUser") + err; 149 | break; 150 | default: wmessage.textContent = chrome.i18n.getMessage("optionsErrorLogin") + response.status + err; 151 | } 152 | chrome.runtime.sendMessage({action: "loglines", data: 'Syncmarks Error: ' + wmessage.textContent}); 153 | }); 154 | 155 | wmessage.className = "show"; 156 | setTimeout(function(){wmessage.className = wmessage.className.replace("show", "hide"); }, 5000); 157 | } 158 | 159 | function saveOptions(e) { 160 | if(typeof e !== "undefined") e.preventDefault(); 161 | 162 | let text = chrome.i18n.getMessage("optionsSuccessSave"); 163 | let type = 'info'; 164 | 165 | if(typeof last_sync === "undefined" || last_sync.toString().length <= 0) { 166 | text = chrome.i18n.getMessage("optionsNotUsed"); 167 | type = 'error'; 168 | } 169 | 170 | const cOptions = { 171 | sync: document.getElementById("s_auto").checked, 172 | name: document.getElementById("cname").value, 173 | uuid: document.getElementById("s_uuid").value, 174 | tabs: document.getElementById("s_tabs").checked, 175 | instance: document.getElementById("wdurl").value 176 | }; 177 | 178 | chrome.storage.local.set(cOptions); 179 | chrome.runtime.sendMessage({action: "clientSendOptions", data: cOptions}); 180 | showMsg(text, type); 181 | 182 | chrome.runtime.sendMessage({action: "tabSync", data: cOptions.tabs}); 183 | chrome.runtime.sendMessage({action: "bookmarkSync", data: cOptions.sync}); 184 | } 185 | 186 | function rName() { 187 | chrome.runtime.sendMessage({action: "clientRename", data: this.value}); 188 | } 189 | 190 | function gName() { 191 | chrome.tabs.query({active: true, currentWindow: true}, (tabs) => { 192 | chrome.runtime.sendMessage({action: "clientInfo", tab: tabs[0]['id']}); 193 | }); 194 | } 195 | 196 | function uuidv4() { 197 | return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => 198 | (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) 199 | ) 200 | } 201 | 202 | function restoreOptions() { 203 | chrome.tabs.query({active: true, currentWindow: true}, (tabs) => { 204 | chrome.runtime.sendMessage({action: "clientInfo", tab: tabs[0]['id']}); 205 | }); 206 | 207 | let f_uuid = document.getElementById("s_uuid"); 208 | let f_cname = document.getElementById("cname"); 209 | let f_url = document.getElementById("wdurl"); 210 | let f_auto = document.getElementById("s_auto"); 211 | let f_tabs = document.getElementById("s_tabs"); 212 | let b_login = document.getElementById("blogin"); 213 | 214 | chrome.storage.local.get(null, function(options) { 215 | if(options.instance == undefined) { 216 | showMsg(chrome.i18n.getMessage("infoEmptyConfig"), 'info'); 217 | } 218 | 219 | f_url.defaultValue = options.instance || ""; 220 | checkURL(); 221 | 222 | uuid = (options.uuid === undefined) ? uuidv4():options.uuid; 223 | f_cname.placeholder = uuid; 224 | f_uuid.defaultValue = uuid; 225 | f_auto.defaultChecked = options.sync; 226 | 227 | gName(); 228 | 229 | if(options.token === undefined) { 230 | b_login.disabled = false; 231 | b_login.style.backgroundColor = "red"; 232 | } 233 | f_tabs.defaultChecked = (options.tabs == undefined) ? false:options.tabs; 234 | 235 | last_sync = options.last_sync || 0; 236 | if(last_sync.toString().length > 0) { 237 | f_auto.removeAttribute("disabled"); 238 | } 239 | 240 | checkForm(); 241 | 242 | chrome.permissions.getAll(function(e) { 243 | if(e.permissions.includes('bookmarks') === false) { 244 | f_auto.disabled = true; 245 | f_auto.checked = false; 246 | } 247 | 248 | if(e.permissions.includes('tabs') === false) { 249 | f_tabs.disabled = true; 250 | f_tabs.checked = false; 251 | } 252 | }); 253 | 254 | if(chrome.commands) chrome.commands.getAll((commands) => { 255 | for (let {name, shortcut} of commands) { 256 | var s = (name === 'bookmark-tab') ? shortcut:'undef'; 257 | } 258 | }); 259 | }); 260 | } 261 | 262 | function manualImport(e) { 263 | e.preventDefault(); 264 | if (this.id === 'iyes') { 265 | chrome.runtime.sendMessage({action: "removeAllMarks"}); 266 | } 267 | 268 | try { 269 | chrome.tabs.query({active: true, currentWindow: true}, (tabs) => { 270 | chrome.runtime.sendMessage({action: "bookmarkExport", data: 'json', tab: tabs[0]['id']}); 271 | }); 272 | } catch(error) { 273 | chrome.runtime.sendMessage({action: "loglines", data: error}); 274 | } finally { 275 | document.getElementById("impdialog").style.display = "none"; 276 | chrome.storage.local.set({last_s: 1}); 277 | } 278 | } 279 | 280 | function manualExport(e) { 281 | e.preventDefault(); 282 | try { 283 | chrome.runtime.sendMessage({action: "exportPHPMarks"}); 284 | } catch(error) { 285 | chrome.runtime.sendMessage({action: "loglines", data: error}); 286 | } finally { 287 | document.getElementById("expdialog").style.display = "none"; 288 | chrome.storage.local.set({last_s: 1}); 289 | } 290 | } 291 | 292 | function localizeHtmlPage() { 293 | var objects = document.getElementsByTagName('span'); 294 | for (var j = 0; j < objects.length; j++) { 295 | var obj = objects[j]; 296 | var valStrH = obj.innerHTML.toString(); 297 | var valNewH = valStrH.replace(/__MSG_(\w+)__/g, function(match, v1) { 298 | return v1 ? chrome.i18n.getMessage(v1) : ""; 299 | }); 300 | 301 | if(valNewH != valStrH) { 302 | obj.innerText = valNewH; 303 | } 304 | } 305 | 306 | document.getElementById('oauto').title = chrome.i18n.getMessage("ManAuto"); 307 | document.getElementById('nuser').placeholder = chrome.i18n.getMessage("optionsUsername"); 308 | document.getElementById('npassword').placeholder = chrome.i18n.getMessage("optionsPassword"); 309 | document.getElementById('title').innerText = chrome.i18n.getMessage("extensionName") + " - " + chrome.i18n.getMessage("optionsBTNSettings"); 310 | document.getElementById('obmc').title = chrome.i18n.getMessage("optionsTabsHint"); 311 | } 312 | 313 | function filterLog() { 314 | chrome.runtime.sendMessage({action: "getLoglines"}); 315 | } 316 | 317 | function rLoglines(loglines) { 318 | let larea = document.getElementById("logarea"); 319 | let lines = loglines.split("\n"); 320 | let debug = document.getElementById('logdebug').checked; 321 | let tlines = new Array(); 322 | 323 | lines.forEach(function(line, key) { 324 | if(debug) { 325 | tlines.push(line); 326 | } else if(!debug && line.indexOf("Debug:") < 0) { 327 | tlines.push(line); 328 | } 329 | }); 330 | 331 | let rlines = tlines.join("\n"); 332 | let logp = new DOMParser().parseFromString(rlines, 'text/html').body; 333 | 334 | var existingLog=larea.querySelector('body'); 335 | if(existingLog) { 336 | existingLog.replaceWith(logp); 337 | } else { 338 | larea.appendChild(logp); 339 | } 340 | } 341 | 342 | function openTab(tabname) { 343 | let x = document.getElementsByClassName("otabs"); 344 | let larea = document.getElementById("logarea"); 345 | 346 | if(larea.childNodes.length > 2) { 347 | larea.removeChild(larea.childNodes[2]); 348 | } 349 | 350 | if(tabname.target.dataset.val == 'logfile') { 351 | chrome.runtime.sendMessage({action: "getLoglines"}); 352 | } 353 | 354 | for (var i = 0; i < x.length; i++) { 355 | x[i].style.display = "none"; 356 | } 357 | 358 | document.getElementById(tabname.target.attributes['data-val'].value).style.display = "block"; 359 | document.querySelectorAll('.tab-button').forEach(function(e) { 360 | e.classList.remove("abutton"); 361 | }); 362 | document.querySelector('button[data-val="'+ tabname.target.attributes['data-val'].value +'"]').classList.add("abutton"); 363 | } 364 | 365 | function saveLog() { 366 | var logfile = document.querySelector("#logarea body").innerText; 367 | var element = document.createElement('a'); 368 | element.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent(logfile); 369 | element.download = 'SyncMarks.log'; 370 | element.style.display = 'none'; 371 | document.body.appendChild(element); 372 | element.click(); 373 | document.body.removeChild(element); 374 | } 375 | 376 | function clearLog() { 377 | chrome.runtime.sendMessage({action: "emptyLoglines"}); 378 | } 379 | 380 | function requestHostPermission() { 381 | const instance = document.getElementById('wdurl'); 382 | let newOrigin = new URL(instance.value).origin + '/*'; 383 | chrome.permissions.request({ 384 | origins: [newOrigin] 385 | }, (granted) => { 386 | const message = (granted) ? 'Syncmarks: Access to ' + newOrigin + ' granted':'Syncmarks Warning: Access to ' + newOrigin + ' denied'; 387 | chrome.runtime.sendMessage({action: "loglines", data: message}); 388 | checkURL(); 389 | }); 390 | } 391 | 392 | function requestClientOptions(cOptions, av = false) { 393 | chrome.storage.local.get(null, function(options) { 394 | if(cOptions !== undefined && cOptions.length > 0) { 395 | select = document.getElementById('cimport'); 396 | select.length = 0; 397 | cOptions.forEach((client) => { 398 | var opt = document.createElement('option'); 399 | opt.value = client['cOptions']; 400 | opt.innerText = client['cname'] 401 | select.appendChild(opt); 402 | if(options.uuid == client['cid']) av = true; 403 | }); 404 | 405 | if(!av) document.getElementById('coptionsdialog').style.display = 'block'; 406 | } 407 | }); 408 | } 409 | 410 | function serverImport() { 411 | const current_uuid = document.getElementById('s_uuid').value; 412 | const url = document.getElementById('wdurl').value; 413 | const clientSelect = document.getElementById("cimport"); 414 | const restored_Options = JSON.parse(clientSelect.value); 415 | let selectedText = clientSelect.options[clientSelect.selectedIndex].text; 416 | 417 | const restored_uuid = restored_Options.uuid; 418 | const creds = btoa(document.getElementById('nuser').value + ':' + document.getElementById('npassword').value); 419 | 420 | document.getElementById('cname').value = (selectedText != restored_Options.name) ? selectedText:restored_Options.name; 421 | document.getElementById("s_tabs").checked = restored_Options.tabs; 422 | document.getElementById("s_auto").checked = restored_Options.sync; 423 | 424 | document.getElementById("coptionsdialog").style.display = "none"; 425 | 426 | saveOptions(); 427 | 428 | setTimeout(() => { 429 | if(confirm(chrome.i18n.getMessage("infoRestoreID"))) { 430 | const params = { 431 | action: 'clientRemove', 432 | client: current_uuid, 433 | data: { 434 | new: current_uuid, 435 | old: restored_uuid 436 | } 437 | } 438 | 439 | fetch(url + '?api=v1', { 440 | method: "POST", 441 | cache: "no-cache", 442 | headers: { 443 | 'Content-type': 'application/json;charset=UTF-8', 444 | 'Authorization': 'Basic ' + creds, 445 | }, 446 | redirect: "follow", 447 | referrerPolicy: "no-referrer", 448 | body: JSON.stringify(params) 449 | }).then(response => { 450 | let xRinfo = response.headers.get("X-Request-Info"); 451 | if (xRinfo != null) chrome.storage.local.set({token:xRinfo}); 452 | return response.json(); 453 | }).then(responseData => { 454 | chrome.runtime.sendMessage({action: "loglines", data: 'Info: Old client removed'}); 455 | }).catch(err => { 456 | chrome.runtime.sendMessage({action: "loglines", data: 'Error: ' + err}); 457 | }); 458 | } 459 | }, 500); 460 | } 461 | 462 | function checkURL() { 463 | let url = document.getElementById('wdurl'); 464 | var xhr = new XMLHttpRequest(); 465 | xhr.open("GET", url.value, true); 466 | xhr.onreadystatechange = function () { 467 | if(xhr.readyState === 4 && xhr.status === 204) { 468 | url.classList.add('valid'); 469 | url.nextElementSibling.classList.add('valid'); 470 | url.classList.remove('invalid'); 471 | url.nextElementSibling.classList.remove('invalid'); 472 | document.getElementById('blogin').disabled = false; 473 | } else { 474 | url.classList.add('invalid'); 475 | url.nextElementSibling.classList.add('invalid'); 476 | url.classList.remove('valid'); 477 | url.nextElementSibling.classList.remove('valid'); 478 | document.getElementById('blogin').disabled = true; 479 | } 480 | } 481 | xhr.setRequestHeader('X-Action', 'verify'); 482 | xhr.send(null); 483 | } 484 | 485 | document.addEventListener("DOMContentLoaded", restoreOptions); 486 | 487 | window.addEventListener('load', function () { 488 | var rawFile = new XMLHttpRequest(); 489 | rawFile.open("GET", "../CHANGELOG.md", true); 490 | rawFile.responseType = "text"; 491 | rawFile.onreadystatechange = function () { 492 | if(rawFile.readyState === 4) { 493 | if(rawFile.status === 200 || rawFile.status == 0) { 494 | document.getElementById("changelog").innerText = rawFile.responseText; 495 | } 496 | } 497 | } 498 | rawFile.send(null); 499 | 500 | var imodal = document.getElementById("impdialog"); 501 | var emodal = document.getElementById("expdialog"); 502 | var comodal = document.getElementById("expimpdialog"); 503 | var cmodal = document.getElementById("coptionsdialog"); 504 | 505 | localizeHtmlPage(); 506 | 507 | document.getElementById('version').textContent = chrome.runtime.getManifest().version; 508 | document.getElementById("econf").addEventListener("click", function() {comodal.style.display = "block"}); 509 | document.getElementById("cclose").addEventListener("click", function() {comodal.style.display = "none";}); 510 | document.getElementById("cimp").addEventListener("click", function(e){ 511 | e.preventDefault(); 512 | e.stopPropagation(); 513 | comodal.style.display = "none"; 514 | chrome.runtime.sendMessage({action: "clientGetOptions"}); 515 | }); 516 | document.getElementById("logdebug").addEventListener('change', filterLog); 517 | document.getElementById("iyes").addEventListener("click", manualImport); 518 | document.getElementById("eyes").addEventListener("click", manualExport); 519 | document.getElementById("ino").addEventListener("click", manualImport); 520 | document.getElementById("coimport").addEventListener("click", function(e) { 521 | e.preventDefault(); 522 | e.stopPropagation(); 523 | serverImport(); 524 | }); 525 | document.getElementById("cochancel").addEventListener("click", function(e) { 526 | e.preventDefault(); 527 | e.stopPropagation(); 528 | cmodal.style.display = "none"; 529 | }); 530 | document.getElementById("lchancel").addEventListener("click", function(e) { 531 | e.preventDefault(); 532 | e.stopPropagation(); 533 | document.getElementById("crdialog").style.display = "none"; 534 | }); 535 | document.getElementById("imchancel").addEventListener("click", function(e) { 536 | e.preventDefault(); 537 | e.stopPropagation(); 538 | document.getElementById("expimpdialog").style.display = "none"; 539 | }); 540 | document.getElementById("eno").addEventListener("click", function() { emodal.style.display = "none";}); 541 | document.getElementById("iclose").addEventListener("click", function() {imodal.style.display = "none";}); 542 | document.getElementById("eclose").addEventListener("click", function() {emodal.style.display = "none";}); 543 | document.getElementById("oclose").addEventListener("click", function() {cmodal.style.display = "none";}); 544 | document.getElementById("crclose").addEventListener("click", function() {document.getElementById("crdialog").style.display = "none";}); 545 | document.getElementById("mdownload").addEventListener("click", function() {imodal.style.display = "block"}); 546 | document.getElementById("mupload").addEventListener("click", function() {emodal.style.display = "block"}); 547 | document.getElementById("wdurl").addEventListener("blur", function() { 548 | requestHostPermission(); 549 | checkURL(); 550 | }); 551 | document.getElementById("wdurl").addEventListener("change", checkForm); 552 | document.getElementById("blogin").addEventListener("click", function(e) { 553 | e.preventDefault(); 554 | e.stopPropagation(); 555 | requestHostPermission(); 556 | document.getElementById("nuser").defaultValue = ''; 557 | document.getElementById("npassword").defaultValue = ''; 558 | document.getElementById("crdialog").style.display = "block"; 559 | document.getElementById("nuser").focus(); 560 | }); 561 | 562 | document.getElementById("nuser").addEventListener("input", checkLoginForm); 563 | document.getElementById("npassword").addEventListener("input", checkLoginForm); 564 | document.getElementById('lgin').addEventListener("click", gToken); 565 | document.getElementById("s_tabs").addEventListener("change", saveOptions); 566 | document.getElementById("s_auto").addEventListener("change", saveOptions); 567 | document.getElementById("cname").addEventListener("change", rName); 568 | document.querySelectorAll(".tab-button").forEach(function(e){ e.addEventListener("click", openTab);}); 569 | document.getElementById("logsave").addEventListener("click", saveLog); 570 | document.getElementById("logclear").addEventListener("click", clearLog); 571 | document.querySelector('h1').addEventListener('click', function(){ 572 | window.open(document.getElementById('wdurl').value); 573 | }); 574 | 575 | window.onclick = function(event) { 576 | if (event.target == imodal) { 577 | imodal.style.display = "none"; 578 | } 579 | if (event.target == emodal) { 580 | emodal.style.display = "none"; 581 | } 582 | } 583 | }); 584 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | --------------------------------------------------------------------------------