From 2518a3d17c8767cfb6e0bc81f0b1ef3c32e7bc56 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 8 Nov 2015 01:02:39 -0500 Subject: [PATCH] #906: comment to document fix --- platform/firefox/vapi-background.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 8b66e5a9e..bb49035d2 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -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);