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

this addresses Cu.import throwing as reported in #1004

This commit is contained in:
gorhill 2015-12-04 12:05:02 -05:00
parent 27f87fb57b
commit 7ada31a545

View File

@ -122,9 +122,16 @@ window.addEventListener('unload', function() {
// frameModule needs to be cleared too
var frameModuleURL = vAPI.getURL('frameModule.js');
var frameModule = {};
Cu.import(frameModuleURL, frameModule);
frameModule.contentObserver.unregister();
Cu.unload(frameModuleURL);
// https://github.com/gorhill/uBlock/issues/1004
// For whatever reason, `Cu.import` can throw -- at least this was
// reported as happening for Pale Moon 25.8.
try {
Cu.import(frameModuleURL, frameModule);
frameModule.contentObserver.unregister();
Cu.unload(frameModuleURL);
} catch (ex) {
}
});
/******************************************************************************/