browser.tabs.get(Number('5'), callback) doesn't work in Edge

By design Issue #11183879


Adolf D.
Mar 6, 2017
This issue is public.
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

browser.tabs.get() API is treating Number(‘5’) different than parseInt('5’, 10).

In our code, we were converting a “string” number (like ‘5’) to an integer using Number(string) but it fails with “Invalid Input” error for browser.tabs.get() API. It works fine only if we use parseInt('5’, 10).

// this works
browser.tabs.getCurrent(function(tab) {
// works
browser.tabs.get(, function(tab) {
console.log("tab Id: " +;
var strTabId = “” +;
// works
browser.tabs.get(parseInt(strTabId, 10), function(tab) {
console.log("tab Id: " +;

// doesn't work. throws "invalid input" error
browser.tabs.get(Number(strTabId), function(tab) {
  console.log("tab Id: " +;


What is the difference between the two usage in terms of browser.tabs.get()?


1 attachment

Comments and activity

You need to sign in to your Microsoft account to add a comment.

Sign in