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

Confirmed Issue #11183879 • Assigned to Mahesh J.


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

  • Microsoft Edge Team

    Changed Status to “By design”

  • Hi Adolf,


    Both usages are
    the same.  This function does not support method overloading and requires
    an ‘integer’ for the ‘tabId’ as a parameter.  The second usage you listed
    is passing a JavaScript ‘Number’ object and not an integer.  This is why
    you are seeing the “Invalid Input” error. More information on the Number object
    in Javascript



    Here are more
    details and an example.

    you could also use Number.parseInt()



    All the best,

    The MS Edge Team  

  • Microsoft Edge Team

    Changed Assigned To to “Sebastian P.”

  • I ran a test, and Chrome supports this, so this is a minor interop issue we should be tracking. 

  • Microsoft Edge Team

    Changed Status from “By design”

    Changed Status to “Confirmed”

    Changed Status from “Confirmed”

    Changed Assigned To from “Sebastian P.” to “Irfan A.”

    Changed Status to “Confirmed”

    Changed Assigned To from “Irfan A.” to “Mahesh J.”

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

Sign in