comment
This commit is contained in:
parent
2f2b417b04
commit
c37bd92e78
|
@ -15,6 +15,11 @@ self.INJECTED !== 1 && (() => {
|
||||||
if (!self.chrome) return;
|
if (!self.chrome) return;
|
||||||
// the rest is for content scripts and our extension pages
|
// the rest is for content scripts and our extension pages
|
||||||
|
|
||||||
|
/* Promisifies the specified `chrome` methods into `browser`.
|
||||||
|
The definitions is an object like this: {
|
||||||
|
'storage.sync': ['get', 'set'], // if deeper than one level, combine the path via `.`
|
||||||
|
windows: ['create', 'update'], // items and sub-objects will only be created if present in `chrome`
|
||||||
|
} */
|
||||||
self.promisifyChrome = definitions => {
|
self.promisifyChrome = definitions => {
|
||||||
// a web page may have <html id="browser"> which creates a global variable `browser` pointing to this element
|
// a web page may have <html id="browser"> which creates a global variable `browser` pointing to this element
|
||||||
if (!self.browser || !self.browser.runtime && !self.browser.promisifyChrome) {
|
if (!self.browser || !self.browser.runtime && !self.browser.promisifyChrome) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user