diff --git a/browser/extensions/screenshots/background/auth.js b/browser/extensions/screenshots/background/auth.js index b8a2ad121d32..ef879b97c8de 100644 --- a/browser/extensions/screenshots/background/auth.js +++ b/browser/extensions/screenshots/background/auth.js @@ -3,7 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ /* globals log */ -/* globals main, makeUuid, deviceInfo, analytics, catcher, buildSettings, communication, browser */ +/* globals main, makeUuid, deviceInfo, analytics, catcher, communication, browser */ "use strict"; @@ -177,7 +177,7 @@ this.auth = (function() { }; exports.getSentryPublicDSN = function() { - return sentryPublicDSN || buildSettings.defaultSentryDsn; + return sentryPublicDSN; }; exports.getAbTests = function() { diff --git a/browser/extensions/screenshots/background/main.js b/browser/extensions/screenshots/background/main.js index a463744b05f6..b028d4c36f28 100644 --- a/browser/extensions/screenshots/background/main.js +++ b/browser/extensions/screenshots/background/main.js @@ -2,12 +2,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* globals browser, getStrings, selectorLoader, analytics, communication, catcher, log, makeUuid, auth, senderror, startBackground, blobConverters buildSettings, startSelectionWithOnboarding */ +/* globals browser, getStrings, selectorLoader, analytics, communication, catcher, log, makeUuid, auth, senderror, startBackground, blobConverters, startSelectionWithOnboarding */ "use strict"; this.main = (function() { const exports = {}; + const pngToJpegCutoff = 2500000; const { sendEvent, incrementCount } = analytics; @@ -182,8 +183,7 @@ this.main = (function() { canvas.getContext("2d").putImageData(imageData, 0, 0); let dataUrl = canvas.toDataURL(); if ( - buildSettings.pngToJpegCutoff && - dataUrl.length > buildSettings.pngToJpegCutoff + dataUrl.length > pngToJpegCutoff ) { const jpegDataUrl = canvas.toDataURL("image/jpeg"); if (jpegDataUrl.length < dataUrl.length) { diff --git a/browser/extensions/screenshots/background/selectorLoader.js b/browser/extensions/screenshots/background/selectorLoader.js index 2312469af015..d8e9d896fbb2 100644 --- a/browser/extensions/screenshots/background/selectorLoader.js +++ b/browser/extensions/screenshots/background/selectorLoader.js @@ -15,7 +15,6 @@ this.selectorLoader = (function() { // These modules are loaded in order, first standardScripts and then selectorScripts // The order is important due to dependencies const standardScripts = [ - "build/buildSettings.js", "log.js", "catcher.js", "assertIsTrusted.js", diff --git a/browser/extensions/screenshots/background/takeshot.js b/browser/extensions/screenshots/background/takeshot.js index 22d8e4f71eb1..aafa302b874e 100644 --- a/browser/extensions/screenshots/background/takeshot.js +++ b/browser/extensions/screenshots/background/takeshot.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* globals browser, communication, shot, main, auth, catcher, analytics, buildSettings, blobConverters, thumbnailGenerator */ +/* globals browser, communication, shot, main, auth, catcher, analytics, blobConverters, thumbnailGenerator */ "use strict"; diff --git a/browser/extensions/screenshots/build/buildSettings.js b/browser/extensions/screenshots/build/buildSettings.js deleted file mode 100644 index b9b542451182..000000000000 --- a/browser/extensions/screenshots/build/buildSettings.js +++ /dev/null @@ -1,14 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -window.buildSettings = { - defaultSentryDsn: "", - logLevel: "" || "warn", - captureText: "" === "true", - uploadBinary: "" === "true", - pngToJpegCutoff: parseInt("" || 2500000, 10), - maxImageHeight: parseInt("" || 10000, 10), - maxImageWidth: parseInt("" || 10000, 10), -}; -null; diff --git a/browser/extensions/screenshots/log.js b/browser/extensions/screenshots/log.js index 96be7e57edbc..e38165e9cfa8 100644 --- a/browser/extensions/screenshots/log.js +++ b/browser/extensions/screenshots/log.js @@ -9,17 +9,15 @@ this.log = (function() { const exports = {}; + const logLevel = "warn"; const levels = ["debug", "info", "warn", "error"]; - if (!levels.includes(buildSettings.logLevel)) { - console.warn("Invalid buildSettings.logLevel:", buildSettings.logLevel); - } const shouldLog = {}; { let startLogging = false; for (const level of levels) { - if (buildSettings.logLevel === level) { + if (logLevel === level) { startLogging = true; } if (startLogging) { diff --git a/browser/extensions/screenshots/manifest.json b/browser/extensions/screenshots/manifest.json index c0b1421c9d59..0ca08f6f6d1c 100644 --- a/browser/extensions/screenshots/manifest.json +++ b/browser/extensions/screenshots/manifest.json @@ -15,7 +15,6 @@ "l10n_resources": [ "browser/screenshots.ftl" ], "background": { "scripts": [ - "build/buildSettings.js", "background/startBackground.js" ] }, @@ -31,7 +30,6 @@ { "matches": ["https://screenshots.firefox.com/*"], "js": [ - "build/buildSettings.js", "log.js", "catcher.js", "selector/callBackground.js", diff --git a/browser/extensions/screenshots/moz.build b/browser/extensions/screenshots/moz.build index 61377c734df0..267d9005d28f 100644 --- a/browser/extensions/screenshots/moz.build +++ b/browser/extensions/screenshots/moz.build @@ -38,7 +38,6 @@ FINAL_TARGET_FILES.features["screenshots@mozilla.org"]["background"] += [ ] FINAL_TARGET_FILES.features["screenshots@mozilla.org"]["build"] += [ - "build/buildSettings.js", "build/inlineSelectionCss.js", "build/raven.js", "build/selection.js", diff --git a/browser/extensions/screenshots/selector/shooter.js b/browser/extensions/screenshots/selector/shooter.js index 70eb59c5a813..68d59ac3efed 100644 --- a/browser/extensions/screenshots/selector/shooter.js +++ b/browser/extensions/screenshots/selector/shooter.js @@ -3,7 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ /* globals global, browser, documentMetadata, util, uicontrol, ui, catcher */ -/* globals buildSettings, domainFromUrl, randomString, shot, blobConverters */ +/* globals domainFromUrl, randomString, shot, blobConverters */ "use strict"; diff --git a/browser/extensions/screenshots/selector/ui.js b/browser/extensions/screenshots/selector/ui.js index 146416dcd6cd..8a7a37bec562 100644 --- a/browser/extensions/screenshots/selector/ui.js +++ b/browser/extensions/screenshots/selector/ui.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* globals browser, log, util, catcher, inlineSelectionCss, callBackground, assertIsTrusted, assertIsBlankDocument, buildSettings blobConverters */ +/* globals browser, log, util, catcher, inlineSelectionCss, callBackground, assertIsTrusted, assertIsBlankDocument, blobConverters */ "use strict"; diff --git a/browser/extensions/screenshots/selector/uicontrol.js b/browser/extensions/screenshots/selector/uicontrol.js index 35dc8f3fe2a9..ac109ea63dd7 100644 --- a/browser/extensions/screenshots/selector/uicontrol.js +++ b/browser/extensions/screenshots/selector/uicontrol.js @@ -3,7 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ /* globals log, catcher, util, ui, slides, global */ -/* globals shooter, callBackground, selectorLoader, assertIsTrusted, buildSettings, selection */ +/* globals shooter, callBackground, selectorLoader, assertIsTrusted, selection */ "use strict"; @@ -49,8 +49,8 @@ this.uicontrol = (function() { const { watchFunction, watchPromise } = catcher; - const MAX_PAGE_HEIGHT = buildSettings.maxImageHeight; - const MAX_PAGE_WIDTH = buildSettings.maxImageWidth; + const MAX_PAGE_HEIGHT = 10000; + const MAX_PAGE_WIDTH = 10000; // An autoselection smaller than these will be ignored entirely: const MIN_DETECT_ABSOLUTE_HEIGHT = 10; const MIN_DETECT_ABSOLUTE_WIDTH = 30; diff --git a/devtools/server/actors/utils/capture-screenshot.js b/devtools/server/actors/utils/capture-screenshot.js index 017db5f337fa..a58b534b0885 100644 --- a/devtools/server/actors/utils/capture-screenshot.js +++ b/devtools/server/actors/utils/capture-screenshot.js @@ -13,7 +13,7 @@ const L10N = new LocalizationHelper(STRINGS_URI); // These values are used to truncate the resulting image if the captured area is bigger. // This is to avoid failing to produce a screenshot at all. // It is recommended to keep these values in sync with the corresponding screenshots addon -// values in /browser/extensions/screenshots/build/buildSettings.js +// values in /browser/extensions/screenshots/selector/uicontrol.js const MAX_IMAGE_WIDTH = 10000; const MAX_IMAGE_HEIGHT = 10000;