Skip to content

Commit

Permalink
Replace window usage in the background (#1192)
Browse files Browse the repository at this point in the history
The background "page" of an extension is replaced with a background
ServiceWorker in Chrome MV3. ServiceWorker's do not have access to the
`window` Object, instead `self` or `globalThis` must be used.
  • Loading branch information
kzar committed May 24, 2022
1 parent b3e9484 commit ad0efbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shared/js/background/debug.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const https = require('./https.es6')
const tds = require('./storage/tds.es6')
const messageHandlers = require('./message-handlers')

window.dbg = {
self.dbg = {
settings,
tabManager,
atb,
Expand Down
2 changes: 1 addition & 1 deletion shared/js/shared-utils/parse-user-agent-string.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = (uaString) => {
version = parsedUaParts[2]

// Brave doesn't include any information in the UserAgent
if (window.navigator.brave) {
if (globalThis.navigator.brave) {
browser = 'Brave'
}
} catch (e) {
Expand Down

0 comments on commit ad0efbb

Please sign in to comment.