mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
#906: comment to document fix
This commit is contained in:
parent
1c6d969ccb
commit
2518a3d17c
@ -3147,6 +3147,10 @@ vAPI.contextMenu.register = (function() {
|
|||||||
contextMenu.insertBefore(menuitem, doc.getElementById('inspect-separator'));
|
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) {
|
var registerSafely = function(doc) {
|
||||||
if ( doc.readyState !== 'complete' ) {
|
if ( doc.readyState !== 'complete' ) {
|
||||||
vAPI.setTimeout(registerSafely.bind(this, doc), 200);
|
vAPI.setTimeout(registerSafely.bind(this, doc), 200);
|
||||||
|
Loading…
Reference in New Issue
Block a user