New issue
Advanced search Search tips

Issue 867316 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 523634
Owner: ----
Closed: Today
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

onbeforenavigate event handler not always called when a tab is restored after browser startup

Reported by cpextens...@gmail.com, Jul 25

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

Steps to reproduce the problem:
1. create a browser extension having the following background page code and the 'webNavigation' permission:

chrome.webNavigation.onBeforeNavigate.addListener((details) => {
    console.log('onbeforenavigate called for url', details.url);
});

alternatively installed the attached extension.
the extension sets an event listener to onbeforenavigate which prints a message to the console when it's called 

2. go to chrome://settings: 
- in the "on startup" section select "continue where i left off". 
- turn off "Continue running background apps when Google Chrome is closed"

3. leave a single tab open, for example "https://www.bing.com"

4. restart the browser
5. open the test extension background page developer tool and examine the console output

What is the expected behavior?
onBeforeNavigate event handler should be called for the main frame of site in the restored tab. the "test extension" background page console should display:

"onbeforenavigate called for url https://www.bing.com/"

What went wrong?
onBeforeNavigate event handler is not always called for the main frame of the restored tab

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 67.0.3396.99  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
test_extension.zip
1.9 KB Download
Chrome loads extensions' background pages asynchronously after the tabs start loading. This is done to speed up the startup time, which is considerably better in Chrome compared to say Firefox under the same conditions. Personally, I doubt Chrome will ever wait for extensions, partly because it'll become a weak point - malicious or badly written extensions will be able to slow down the initial loading or even prevent Chrome from running.
Components: Platform>Extensions
Labels: Needs-Triage-M67
Cc: phanindra.mandapaka@chromium.org
Labels: Triaged-ET Needs-Feedback
Unable to reproduce the issue on reported chrome version 67.0.3396.99 and latest chrome stable 68.0.3440.106 using Windows 10.Attaching screen-cast for reference.
Steps: 
---------
1. Launched reported chrome 
2. Downloaded given extension and added to chrome 
3. Followed the steps as per original comment#0 
As we are able to see the "onbeforenavigate called for url https://www.bing.com/"

@Reporter: Request you to retry this issue with fresh profile without any extensions/apps or reset all the flags and let us know if issue still persists.Could you please upgrade to latest chrome stable 68.0.3440.106, you can download latest chrome builds 
here:" https://www.chromium.org/getting-involved/dev-channel ".

Thanks.!
867316.mp4
2.5 MB View Download
Duplicate of issue 523634.

Comment 6 by viswa.karala@chromium.org, Today (33 minutes ago)

Cc: viswa.karala@chromium.org
Mergedinto: 523634
Status: Duplicate (was: Unconfirmed)
As per comment# 5 from the reporter, merging into Issue: 523634 and marking it as Duplicate.

Thanks!

Sign in to add a comment