diff --git a/pages/updates/updates.html b/pages/updates/updates.html index a2e4854d..c583379f 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -18,11 +18,17 @@
+

Please notice

-

Do you use Firefox/Chromium Sync or your own sync server? If not, you can ignore the following.

+

1.) Do you use Firefox/Chromium Sync or your own sync server?

In LocalCDN v2.4.0 the default storage type has been changed from sync to local. If you want to change this, you can do this in the settings. Please recognize that not all data are synced. More information can be found in the FAQs

+

2.) Extension settings

+

Your extension settings should be automatically transferred from sync to local, but in some cases the migration may fail. If you want, you can your extension settings to a file and import them on the options page.

+

Release notes

diff --git a/pages/updates/updates.js b/pages/updates/updates.js index 8e2a0bdc..de44da09 100644 --- a/pages/updates/updates.js +++ b/pages/updates/updates.js @@ -39,6 +39,11 @@ updates._openHistoryReleaseNotes = function () { }; updates._onDocumentLoaded = function () { + // ******************************************************************************** + // TODO: Remove me in v2.4.1 + document.getElementById('export').addEventListener('click', updates._export); + // ******************************************************************************** + document.getElementById('generate-ublock-rules').checked = false; document.getElementById('generate-umatrix-rules').checked = false; @@ -61,5 +66,21 @@ updates._onDocumentLoaded = function () { document.getElementById('generator-section').style.display = 'block'; } }; +// ******************************************************************************** +// TODO: Remove me in v2.4.1 +updates._export = function () { + let filename = new Date().toISOString(); + filename = filename.substring(0, 10) + '_localcdn_backup.txt'; + chrome.storage.sync.get(null, function (items) { + let element = document.createElement('a'); + element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(JSON.stringify(items, null, ' '))); + element.setAttribute('download', filename); + element.style.display = 'none'; + document.body.appendChild(element); + element.click(); + document.body.removeChild(element); + }); +}; +// ******************************************************************************** document.addEventListener('DOMContentLoaded', updates._onDocumentLoaded);