mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Fix spurious error message in dev console
Ports can be disconnected under certain conditions, and in such case runtime.lastError must be accessed to avoid the extensions framework from emitting error messages in the console.
This commit is contained in:
parent
dc08478130
commit
2eb02c5adc
1 changed files with 7 additions and 5 deletions
|
|
@ -97,9 +97,12 @@ vAPI.messaging = {
|
|||
// as world-ending, i.e. stay around. Except for embedded frames.
|
||||
|
||||
disconnectListener: function() {
|
||||
void browser.runtime.lastError;
|
||||
this.port = null;
|
||||
if ( window !== window.top ) {
|
||||
vAPI.shutdown.exec();
|
||||
} else {
|
||||
this.destroyPort();
|
||||
}
|
||||
},
|
||||
disconnectListenerBound: null,
|
||||
|
|
@ -129,11 +132,10 @@ vAPI.messaging = {
|
|||
messageListenerBound: null,
|
||||
|
||||
canDestroyPort: function() {
|
||||
return this.pending.size === 0 &&
|
||||
(
|
||||
this.extensions.length === 0 ||
|
||||
this.extensions.every(e => e.canDestroyPort())
|
||||
);
|
||||
return this.pending.size === 0 && (
|
||||
this.extensions.length === 0 ||
|
||||
this.extensions.every(e => e.canDestroyPort())
|
||||
);
|
||||
},
|
||||
|
||||
mustDestroyPort: function() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue