mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
#906: comment to document fix
This commit is contained in:
parent
1c6d969ccb
commit
2518a3d17c
1 changed files with 4 additions and 0 deletions
|
|
@ -3147,6 +3147,10 @@ vAPI.contextMenu.register = (function() {
|
|||
contextMenu.insertBefore(menuitem, doc.getElementById('inspect-separator'));
|
||||
};
|
||||
|
||||
// https://github.com/gorhill/uBlock/issues/906
|
||||
// Be sure document.readyState is 'complete': it could happen at launch
|
||||
// time that we are called by vAPI.contextMenu.create() directly before
|
||||
// the environment is properly initialized.
|
||||
var registerSafely = function(doc) {
|
||||
if ( doc.readyState !== 'complete' ) {
|
||||
vAPI.setTimeout(registerSafely.bind(this, doc), 200);
|
||||
|
|
|
|||
Loading…
Reference in a new issue