mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
this fixes #955
This commit is contained in:
parent
c4e3e1e8e5
commit
50d7a5ebb7
3 changed files with 27 additions and 8 deletions
|
|
@ -2,7 +2,7 @@
|
|||
"manifest_version": 2,
|
||||
|
||||
"name": "uBlock Origin",
|
||||
"version": "1.3.5",
|
||||
"version": "1.3.6",
|
||||
|
||||
"default_locale": "en",
|
||||
"description": "__MSG_extShortDesc__",
|
||||
|
|
|
|||
|
|
@ -2384,15 +2384,34 @@ vAPI.toolbarButton = {
|
|||
});
|
||||
};
|
||||
|
||||
// https://github.com/gorhill/uBlock/issues/955
|
||||
// Defer until `NativeWindow` is available.
|
||||
tbb.initOne = function(win, tryCount) {
|
||||
if ( !win.NativeWindow ) {
|
||||
if ( typeof tryCount !== 'number' ) {
|
||||
tryCount = 0;
|
||||
}
|
||||
tryCount += 1;
|
||||
if ( tryCount < 10 ) {
|
||||
vAPI.setTimeout(
|
||||
this.initOne.bind(this, win, tryCount),
|
||||
200
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
var label = this.getMenuItemLabel();
|
||||
var id = win.NativeWindow.menu.add({
|
||||
name: label,
|
||||
callback: this.onClick
|
||||
});
|
||||
menuItemIds.set(win, id);
|
||||
};
|
||||
|
||||
tbb.init = function() {
|
||||
// Only actually expecting one window under Fennec (note, not tabs, windows)
|
||||
for ( var win of winWatcher.getWindows() ) {
|
||||
var label = this.getMenuItemLabel();
|
||||
var id = win.NativeWindow.menu.add({
|
||||
name: label,
|
||||
callback: this.onClick
|
||||
});
|
||||
menuItemIds.set(win, id);
|
||||
this.initOne(win);
|
||||
}
|
||||
|
||||
cleanupTasks.push(shutdown);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"manifest_version": 2,
|
||||
|
||||
"name": "uBlock Origin",
|
||||
"version": "1.3.5",
|
||||
"version": "1.3.6",
|
||||
|
||||
"default_locale": "en",
|
||||
"description": "__MSG_extShortDesc__",
|
||||
|
|
|
|||
Loading…
Reference in a new issue