1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 04:49:12 +02:00

#906: comment to document fix

This commit is contained in:
gorhill 2015-11-08 01:02:39 -05:00
parent 1c6d969ccb
commit 2518a3d17c

View File

@ -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);