Skip to content

Commit

Permalink
this fixes #955
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Nov 21, 2015
1 parent c4e3e1e commit 50d7a5e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion platform/chromium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,

"name": "uBlock Origin",
"version": "1.3.5",
"version": "1.3.6",

"default_locale": "en",
"description": "__MSG_extShortDesc__",
Expand Down
31 changes: 25 additions & 6 deletions platform/firefox/vapi-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion platform/opera/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,

"name": "uBlock Origin",
"version": "1.3.5",
"version": "1.3.6",

"default_locale": "en",
"description": "__MSG_extShortDesc__",
Expand Down

0 comments on commit 50d7a5e

Please sign in to comment.