Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | * http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | function test() { |
michael@0 | 5 | waitForExplicitFinish(); |
michael@0 | 6 | BrowserOpenTab(); |
michael@0 | 7 | |
michael@0 | 8 | let tab = gBrowser.selectedTab; |
michael@0 | 9 | let browser = tab.linkedBrowser; |
michael@0 | 10 | |
michael@0 | 11 | registerCleanupFunction(function () { gBrowser.removeTab(tab); }); |
michael@0 | 12 | |
michael@0 | 13 | whenBrowserLoaded(browser, function () { |
michael@0 | 14 | browser.loadURI("http://example.com/"); |
michael@0 | 15 | |
michael@0 | 16 | whenBrowserLoaded(browser, function () { |
michael@0 | 17 | ok(!gBrowser.canGoBack, "about:newtab wasn't added to the session history"); |
michael@0 | 18 | finish(); |
michael@0 | 19 | }); |
michael@0 | 20 | }); |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | function whenBrowserLoaded(aBrowser, aCallback) { |
michael@0 | 24 | if (aBrowser.contentDocument.readyState == "complete") { |
michael@0 | 25 | executeSoon(aCallback); |
michael@0 | 26 | return; |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | aBrowser.addEventListener("load", function onLoad() { |
michael@0 | 30 | aBrowser.removeEventListener("load", onLoad, true); |
michael@0 | 31 | executeSoon(aCallback); |
michael@0 | 32 | }, true); |
michael@0 | 33 | } |