Commit 66abd8c1 authored by Richard Pospesel's avatar Richard Pospesel
Browse files

Bug 40057: Error popup when using New Identity feature

parent 448a4fd2
......@@ -556,34 +556,6 @@ async function torbutton_do_new_identity() {
torbutton_log(3, "New Identity: Clearing Image Cache");
torbutton_clear_image_caches();
torbutton_log(3, "New Identity: Clearing Offline Cache");
try {
const LoadContextInfo = Services.loadContextInfo;
for (let contextInfo of [LoadContextInfo.default, LoadContextInfo.private]) {
let appCacheStorage = Services.cache2.appCacheStorage(contextInfo, null);
// The following call (asyncEvictStorage) is actually synchronous, either
// if we have pref "browser.cache.use_new_backend" -> 1 or
// "browser.cache.use_new_backend_temp" -> true,
// then we are using the new cache (cache2) which operates synchronously.
// If we are using the old cache, then the tor-browser.git patch for
// #5715 also makes this synchronous. So we pass a null callback.
try {
appCacheStorage.asyncEvictStorage(null);
} catch (err) {
// We ignore "not available" errors because they occur if a cache
// has not been used, e.g., if no browsing has been done.
if (err.name !== 'NS_ERROR_NOT_AVAILABLE') {
throw err;
}
}
}
} catch(e) {
torbutton_log(5, "Exception on cache clearing: "+e);
window.alert("Torbutton: Unexpected error during offline cache clearing: "+e);
}
torbutton_log(3, "New Identity: Clearing Disk and Memory Caches");
try {
......@@ -1086,8 +1058,11 @@ function torbutton_disable_browser_js(browser) {
torbutton_log(4, "Failed to disable JS events: "+e)
}
if (browser.docShell)
browser.docShell.allowJavascript = false;
let { browsingContext } = browser;
if (browsingContext) {
browsingContext.allowJavascript = false;
}
try {
// My estimation is that this does not get the inner iframe windows,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment