Inconsistent behaviour of the browser.tabs.onUpdated callback

Confirmed Issue #10246170 • Assigned to Akshay P.

Details

Author
Andrey M.
Created
Dec 16, 2016
Privacy
This issue is public.
Reports
Reported by 3 people

Sign in to watch or report this issue.

Steps to reproduce

onUpdated callback receives inconsistent params:
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/onUpdated

Steps to reproduce

Create extension with this code:

function handleUpdated(tabId) {
  console.log("Updated tab: " + tabId);
}

function handleCreated(tab) {
  console.log("Created tab:" + tab.id);
}

browser.tabs.onCreated.addListener(handleCreated);
browser.tabs.onUpdated.addListener(handleUpdated);
  1. Open new tab
  2. Enter bing.com and press enter

Expected result

We should receive the same tabId for each call.

Actual result

// Tab is created
Created tab: 10
Updated tab: 10
Updated tab: 10
// Navigating to bing.com in the same tab, tabId has changed for no reason
Updated tab: 11

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Sebastian P.”

      Changed Assigned To from “Sebastian P.” to “Akshay P.”

      Changed Assigned To from “Akshay P.” to “Mohit R.”

      Changed Status to “Confirmed”

    • Same happened for me but with onBeforeRequest

      browser.webRequest.onBeforeRequest.addListener((event) => {
        console.log(event.tabId, event.url)
      }, {
        urls: [""],
        types: ["main_frame"]
      });
      

      then if I redirect to https://www.ebates.com/backcountry-com_10019-xfas?AutoLoginID=Yk5XnrwWV6cuYT%2FgZwdEaw%3D%3D&tb=yes&domainName=backcountry.com&sourceName=toolbar&toolbarFeatureId=TOPSTORES&toolbarId=284798516&eeid=26142 where it executes redirect in the same tab via location.href = 'http://...' I’m getting updated tabId;

    • Microsoft Edge Team

      Changed Assigned To to “Akshay P.”

      Changed Assigned To to “Akshay P.”

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

    Sign in