How to use tabs - 10 common examples

To help you get started, we’ve selected a few tabs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / hotdish / lib / hotdish.js View on Github external
}
  let w = getMostRecentBrowserWindow();
  style(w);
  hotdishedwindowid = getOuterId(w);  // yes, global
  track(hotdishedwindowid);
  hub.address = "https://hub.togetherjs.com/hub/" + myprefs.groupId;
  hub.clientId = myprefs.clientId;
  hub.open();
  var url = self.data.url("socialapi/index.html") + "?";
  url += "groupId=" + encodeURIComponent(myprefs.groupId);
  url += "&clientId=" + encodeURIComponent(myprefs.clientId);
  require("tabs").open(url);
  var debugUrl = self.data.url("debug/index.html") + "?";
  debugUrl += "groupId=" + encodeURIComponent(myprefs.groupId);
  debugUrl += "&clientId=" + encodeURIComponent(myprefs.clientId);
  require("tabs").open(debugUrl);
  hub.sidebar.on("ready", function () {
    sendHello(false);
  });
  track();
};
github mozilla / hotdish / lib / hotdish.js View on Github external
let dish = exports.dish = function() {
  if (hotdishedwindowid !== undefined) {
    // one at a time!
    return;
  }
  let w = getMostRecentBrowserWindow();
  style(w);
  hotdishedwindowid = getOuterId(w);  // yes, global
  track(hotdishedwindowid);
  hub.address = "https://hub.togetherjs.com/hub/" + myprefs.groupId;
  hub.clientId = myprefs.clientId;
  hub.open();
  var url = self.data.url("socialapi/index.html") + "?";
  url += "groupId=" + encodeURIComponent(myprefs.groupId);
  url += "&clientId=" + encodeURIComponent(myprefs.clientId);
  require("tabs").open(url);
  var debugUrl = self.data.url("debug/index.html") + "?";
  debugUrl += "groupId=" + encodeURIComponent(myprefs.groupId);
  debugUrl += "&clientId=" + encodeURIComponent(myprefs.clientId);
  require("tabs").open(debugUrl);
  hub.sidebar.on("ready", function () {
    sendHello(false);
  });
  track();
};
github watinha / Scale-Tabs / test / test-window_screenshot.js View on Github external
exports.tab_opening = function(test){
  tabs.open("about:blank");
  tabs.open("about:blank");
  tabs.open("about:addons");

  var count_tabs_loaded = 0;
  tabs.on("ready", function(tab){
    count_tabs_loaded++;
    window_screenshot.load_tab_data(tab);
    test.assertEqual(tab.screenshot.substring(0,4), "data", "Testing if the TAB Jetpack object was enhanced with the screenshot attribute for tab" + tab.index);
    if(count_tabs_loaded == 3)
      test.done();
  });

  test.waitUntilDone(30000);
};
github watinha / Scale-Tabs / test / test-window_screenshot.js View on Github external
exports.tab_opening = function(test){
  tabs.open("about:blank");
  tabs.open("about:blank");
  tabs.open("about:addons");

  var count_tabs_loaded = 0;
  tabs.on("ready", function(tab){
    count_tabs_loaded++;
    window_screenshot.load_tab_data(tab);
    test.assertEqual(tab.screenshot.substring(0,4), "data", "Testing if the TAB Jetpack object was enhanced with the screenshot attribute for tab" + tab.index);
    if(count_tabs_loaded == 3)
      test.done();
  });

  test.waitUntilDone(30000);
};
github bgirard / Gecko-Profiler-Addon / src / lib / perf_tests / basic.js View on Github external
function run_google(done) {
  tabs.open({
    url: "http://www.cnn.com",
    onReady: function onReady(tab) {
      timers.setTimeout(function wait_for_load() {
        dump("loaded page\n");
        done();
      }, 2000);
    }
  });
}
github mozilla / fx-share-addon / tests / test_utils.js View on Github external
exports.createTab = function(url, callback) {
  tabs.open({
    url: url,
    onOpen: function onOpen(tab) {
      tab.on('ready', function(tab){
        callback(tab);
      });
    }
  });
}
github Opquast / opquast-desktop / lib / opquast-panel.js View on Github external
let TestFeedback = function(aContentWindow, aValue) {
    let feedback_url = _("oqs.feedback_url")
        + "?title=" + encodeURIComponent(_("oqs.feedback_title", aValue.test_id))
        + "&desc=" + encodeURIComponent(_("oqs.feedback_content",
            aContentWindow.location.href, aValue.test_id, aValue.test_name, aValue.checklist
        ));

    tabs.open(feedback_url);
};
github Opquast / opquast-desktop / lib / app / panels / results.js View on Github external
testFeedback: catchAndLog(function testFeedback(testID, testName, checklist) {
        let domWindow = this.parent.dock.getCurrentTabWindow();

        let feedback_url = _("oqs.feedback_url")
            + "?title=" + encodeURIComponent(_("oqs.feedback_title", testID))
            + "&desc=" + encodeURIComponent(_("oqs.feedback_content",
                domWindow.location.href, testID, testName, checklist
            ));

        tabs.open(feedback_url);
    })
});
github BoringCode / TranslateThis / main.js View on Github external
function translatePage(url, lang) {
if (is_valid_url(url) === true) {
    url = encodeURIComponent(url);
    var translateUrl = "http://translate.google.com/translate?js=n&prev=_t&ie=UTF-8&tl=" + lang + "&u=" + url;
    if ((settings("translate_page")) === "New Tab") {  
         tabs.open(translateUrl);
    } else {
        tabs.activeTab.url = translateUrl;
    }
} else {
    notifications.notify({
     title: "Translate This - Uh Oh!",
     text: "Invalid URL entered. The page to be translated can not be a local file or HTTPS"
    });    
}
}
//translate selected text, or copy translated text to clipboard
github aabilio / PyDownTV2 / plugins / Firefox / lib / main.js View on Github external
onClick: function() {
    tabUrl = tabs.activeTab.url;
    var url = "http://web.pydowntv.com/?url="+escape(tabUrl);
    tabs.open(url);
  }
});

tabs

pure javascript implementation that quickly makes the markup tabbable

MIT
Latest version published 10 years ago

Package Health Score

45 / 100
Full package analysis

Popular tabs functions