diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /browser/components/pocket/content/pktApi.sys.mjs | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/pocket/content/pktApi.sys.mjs')
-rw-r--r-- | browser/components/pocket/content/pktApi.sys.mjs | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/browser/components/pocket/content/pktApi.sys.mjs b/browser/components/pocket/content/pktApi.sys.mjs index 16d0948b36..132f9369ce 100644 --- a/browser/components/pocket/content/pktApi.sys.mjs +++ b/browser/components/pocket/content/pktApi.sys.mjs @@ -47,7 +47,6 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { IndexedDB: "resource://gre/modules/IndexedDB.sys.mjs", - NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", }); @@ -291,12 +290,12 @@ export var pktApi = (function () { "extensions.pocket.oAuthConsumerKey" ); } else { - baseAPIUrl = `https://${lazy.NimbusFeatures.saveToPocket.getVariable( - "bffApi" + baseAPIUrl = `https://${Services.prefs.getStringPref( + "extensions.pocket.bffApi" )}/desktop/v1`; - oAuthConsumerKey = lazy.NimbusFeatures.saveToPocket.getVariable( - "oAuthConsumerKeyBff" + oAuthConsumerKey = Services.prefs.getStringPref( + "extensions.pocket.oAuthConsumerKeyBff" ); } @@ -309,7 +308,7 @@ export var pktApi = (function () { data.locale_lang = Services.locale.appLocaleAsBCP47; data.consumer_key = oAuthConsumerKey; - var request = new XMLHttpRequest(); + var request = new XMLHttpRequest({ mozAnon: false }); if (!useBFF) { request.open("POST", url, true); @@ -317,7 +316,7 @@ export var pktApi = (function () { request.open("GET", url, true); } - request.onreadystatechange = function (e) { + request.onreadystatechange = function () { if (request.readyState == 4) { // "done" is a completed XHR regardless of success/error: if (options.done) { @@ -487,7 +486,7 @@ export var pktApi = (function () { access_token: getAccessToken(), url, }, - success(data) { + success() { if (options.success) { options.success.apply(options, Array.apply(null, arguments)); } @@ -508,7 +507,7 @@ export var pktApi = (function () { data: { access_token: getAccessToken(), }, - success(data) { + success() { if (options.success) { options.success.apply(options, Array.apply(null, arguments)); } @@ -761,8 +760,9 @@ export var pktApi = (function () { access_token: getAccessToken(), }); - const useBFF = - lazy.NimbusFeatures.saveToPocket.getVariable("bffRecentSaves"); + const useBFF = Services.prefs.getBoolPref( + "extensions.pocket.bffRecentSaves" + ); return apiRequest( { @@ -816,8 +816,9 @@ export var pktApi = (function () { { count: 4 }, { success(data) { - const useBFF = - lazy.NimbusFeatures.saveToPocket.getVariable("bffRecentSaves"); + const useBFF = Services.prefs.getBoolPref( + "extensions.pocket.bffRecentSaves" + ); // Don't try to parse bad or missing data if ( |