mirror of https://github.com/gorhill/uBlock.git
Don't use `self` to access `vAPI` in content script
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1571 Testing through `self` breaks the injection of `contentscript-extra.js` in Firefox 66.0 and earlier.
This commit is contained in:
parent
bab6d611eb
commit
a1241e0806
|
@ -230,14 +230,16 @@ vAPI.messaging = {
|
||||||
},
|
},
|
||||||
|
|
||||||
// Dynamically extend capabilities.
|
// Dynamically extend capabilities.
|
||||||
|
//
|
||||||
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/1571
|
||||||
|
// Don't use `self` to access `vAPI`.
|
||||||
extend: function() {
|
extend: function() {
|
||||||
if ( this.extended === undefined ) {
|
if ( this.extended === undefined ) {
|
||||||
this.extended = vAPI.messaging.send('vapi', {
|
this.extended = vAPI.messaging.send('vapi', {
|
||||||
what: 'extendClient'
|
what: 'extendClient'
|
||||||
}).then(( ) => {
|
}).then(( ) =>
|
||||||
return self.vAPI instanceof Object &&
|
typeof vAPI === 'object' && this.extensions.length !== 0
|
||||||
this.extensions.length !== 0;
|
).catch(( ) => {
|
||||||
}).catch(( ) => {
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return this.extended;
|
return this.extended;
|
||||||
|
|
Loading…
Reference in New Issue