Detects where the current browser extension code is being run. Chrome and Firefox.
MIT License
Bot releases are hidden (Show)
The package has been renamed from webext-detect-page
to webext-detect
Run this to upgrade:
npm remove webext-detect-page
npm install webext-detect
And then do a global search and replace in your code.
https://github.com/fregante/webext-detect/compare/v5.0.1...v5.0.2
https://github.com/fregante/webext-detect-page/compare/v5.0.0...v5.0.1
exports
field 5d94b01contextNames
export to be an array of strings 0e7061ehttps://github.com/fregante/webext-detect-page/compare/v4.2.1...v5.0.0
ContextName
type ed73a36https://github.com/fregante/webext-detect-page/compare/v4.2.0...v4.2.1
isPersistentBackgroundPage
(#27) a963d20isDevTools
(#26) 5fab945isSidePanel
(#25) 63c55a4https://github.com/fregante/webext-detect-page/compare/v4.1.1...v4.2.0
Release sponsored by PixieBrix 🎉
https://github.com/fregante/webext-detect-page/compare/v4.1.0...v4.1.1
Release sponsored by PixieBrix 🎉
isMobileSafari
184ecbchttps://github.com/fregante/webext-detect-page/compare/v4.0.1...v4.1.0
contextNames
56ccffbhttps://github.com/fregante/webext-detect-page/compare/v4.0.0...v4.0.1
isBackgroundPage
no longer returns true
in service workers (https://github.com/fregante/webext-detect-page/pull/18)getContextName
returns 'background'
instead of 'backgroundPage'
isBackgroundWorker
to detect Manifest v3 background service workersisBackground
to detect both workers and pagesisBackgroundPage
no longer calls getBackgroundPage
but instead relies on the current URL and the manifest for detectionRelease sponsored by PixieBrix 🎉
getContextName
(#17) bd8b9dbRelease sponsored by PixieBrix 🎉
https://github.com/fregante/webext-detect-page/compare/v3.0.2...v3.1.0
isDevToolsPage
detection 0024046isOptionsPage
and isDevToolsPage
(#14) f873839https://github.com/fregante/webext-detect-page/compare/v3.0.1...v3.0.2
isDevToolsPage
(#6) 739c222isWebPage
and isExtensionContext
ac7ac1aisChrome
, isFirefox
, isSafari
(#10) 7d1eab8globalThis
and optional chaining operator 9db0769 d51ce6d (this increases the minimum browser version)Release sponsored by PixieBrix 🎉
https://github.com/fregante/webext-detect-page/compare/v2.0.6...v3.0.1
isBackgroundPage
566e0a9https://github.com/fregante/webext-detect-page/compare/v2.0.5...v2.0.6