From 8518e00ce1013978bebde2c8ddf36766c982ab87 Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Thu, 4 Jul 2019 17:54:50 +0200 Subject: Make vapi-cloud its own file --- js/vapi-background.js | 128 -------------------------------------------------- 1 file changed, 128 deletions(-) (limited to 'js/vapi-background.js') diff --git a/js/vapi-background.js b/js/vapi-background.js index 3f73af7..067707c 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -1266,132 +1266,4 @@ return url; }; - - vAPI.cloud = (function () { - let extensionBranchPath = 'extensions.' + location.host; - let cloudBranchPath = extensionBranchPath + '.cloudStorage'; - - // https://github.com/gorhill/uBlock/issues/80#issuecomment-132081658 - // We must use get/setComplexValue in order to properly handle strings - // with unicode characters. - let iss = Ci.nsISupportsString; - let argstr = Components.classes['@mozilla.org/supports-string;1'] - .createInstance(iss); - - let options = { - defaultDeviceName: '', - deviceName: '' - }; - - // User-supplied device name. - try { - options.deviceName = Services.prefs - .getBranch(extensionBranchPath + '.') - .getComplexValue('deviceName', iss) - .data; - } catch(ex) { - // Ignore - } - - var getDefaultDeviceName = function() { - var name = ''; - try { - name = Services.prefs - .getBranch('services.sync.client.') - .getComplexValue('name', iss) - .data; - } catch(ex) { - // Ignore - } - - return name || window.navigator.platform || window.navigator.oscpu; - }; - - let start = function (dataKeys) { - let extensionBranch = - Services.prefs.getBranch(extensionBranchPath + '.'); - let syncBranch = - Services.prefs.getBranch('services.sync.prefs.sync.'); - - // Mark config entries as syncable - argstr.data = ''; - let dataKey; - for (let i=0; i