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.
|
||||
//
|
||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/1571
|
||||
// Don't use `self` to access `vAPI`.
|
||||
extend: function() {
|
||||
if ( this.extended === undefined ) {
|
||||
this.extended = vAPI.messaging.send('vapi', {
|
||||
what: 'extendClient'
|
||||
}).then(( ) => {
|
||||
return self.vAPI instanceof Object &&
|
||||
this.extensions.length !== 0;
|
||||
}).catch(( ) => {
|
||||
}).then(( ) =>
|
||||
typeof vAPI === 'object' && this.extensions.length !== 0
|
||||
).catch(( ) => {
|
||||
});
|
||||
}
|
||||
return this.extended;
|
||||
|
|
Loading…
Reference in New Issue