tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_bug579872.js (1083B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 add_task(async function () {
      6  // eslint-disable-next-line @microsoft/sdl/no-insecure-url
      7  let newTab = BrowserTestUtils.addTab(gBrowser, "http://example.com");
      8  await BrowserTestUtils.browserLoaded(newTab.linkedBrowser);
      9 
     10  gBrowser.pinTab(newTab);
     11  gBrowser.selectedTab = newTab;
     12 
     13  openTrustedLinkIn("javascript:var x=0;", "current");
     14  is(gBrowser.tabs.length, 2, "Should open in current tab");
     15 
     16  // eslint-disable-next-line @microsoft/sdl/no-insecure-url
     17  openTrustedLinkIn("http://example.com/1", "current");
     18  is(gBrowser.tabs.length, 2, "Should open in current tab");
     19 
     20  // eslint-disable-next-line @microsoft/sdl/no-insecure-url
     21  openTrustedLinkIn("http://example.org/", "current");
     22  is(gBrowser.tabs.length, 3, "Should open in new tab");
     23 
     24  await BrowserTestUtils.removeTab(newTab);
     25  await BrowserTestUtils.removeTab(gBrowser.tabs[1]); // example.org tab
     26 });