New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 766331 link

Starred by 5 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Feature



Sign in to add a comment

Allow extensions to set a web page as the new tab page with cleared omnibox [feature request]

Reported by ke...@tabforacause.org, Sep 18 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.18 Safari/537.36

Steps to reproduce the problem:
1. Install a new tab redirect extension (for example, New Tab Redirect: https://chrome.google.com/webstore/detail/new-tab-redirect/icpgjfneehieebagbmdbhnlpiopdcmna)
2. Go to the options page in New Tab Redirect. Enter a redirect URL and click "Save". Check the box "Always update tab, not redirect. (Enable for cursor in the address bar)"
3. Open a tab. Note that the omnibox behavior is somewhat unreliable: sometimes the tab update will overwrite the text you're typing, and sometimes the omnibox will not highlight as expected.

What is the expected behavior?
There's not a clean way for Chrome extensions to set the new tab page to an HTTP webpage and while also keeping the omnibox clear or highlighted.

Extensions (such as New Tab Redirect) have worked around this by calling `chrome.tabs.update` after a new tab is created. However, this has problems:
* The tab update can happen after a user starts typing into the omnibox, overwriting their query or preventing navigation
* Whether the omnibox URL will remain highlighted after update appears to be undocumented and unreliable. Extension developers are hoping the behavior doesn't change, but it sometimes regresses:
Chrome 61 regression: https://bugs.chromium.org/p/chromium/issues/detail?id=766012
Chrome 34 regression: https://bugs.chromium.org/p/chromium/issues/detail?id=362322
Ongoing issue since 2014: https://github.com/jimschubert/NewTab-Redirect/issues/50

Potential fixes:
* Allow setting the manifest chrome_url_overrides.newtab value to an HTTP or HTTPS page. Clear or highlight the omnibox URL when opening a new tab. (This won't solve the problem for extension developers that need a dynamic URL, however. Allow for dynamically setting the new tab override URL?)
* Add a new property to chrome.tabs.create and chrome.tabs.update that sets the omnibox to be highlighted (e.g. an omniboxHighlighted boolean).
* Or at the very least, document/guarantee that chrome.tabs.update will keep a highlighted URL.

What went wrong?
When overriding a new tab page with a web page, the omnibox behavior is unpredictable and a poor user experience.

WebStore page: https://chrome.google.com/webstore/detail/new-tab-redirect/icpgjfneehieebagbmdbhnlpiopdcmna

Did this work before? N/A 

Chrome version: 62.0.3202.18  Channel: beta
OS Version: OS X 10.12.6
Flash Version: 

Note: this isn't specific to New Tab Redirect, but to extension development in general. Let me know if there's a more appropriate place to discuss this feature request.
 
As the author of New Tab Redirect, I support this feature request.

While New Tab Redirect may not be the best example of the issue, it is still an issue nonetheless.

My extension loads a simple new tab apps page as main.html, deferring AngularJS until I've checked chrome.storage.local for a user-specified URL which I redirect to (see https://github.com/jimschubert/NewTab-Redirect/blob/master/js/redirect.js).

I receive numerous emails and bugs reported for this behavior. Sometimes, the omnibar receives focus with the URL highlighted after the HTTP redirect or call to chrome.tabs.updated (depending on OS, and Chrome version). Sometimes, it doesn't.

I've had users who have used the extension since 2009 recently (Sept 2017) send emails saying this behavior has changed, presumably one of the regressions linked in the issue description.

In the past, I've looked through Chrome's source code to see if there was a solution to the problem. If I remember correctly, the "chrome" which loads browser plugins and handles the omnibar as well as the new tab override extensions and rendering of those override pages all run in one thread context, while public web traffic and page extensions run in another thread context. I assumed this is for security, and I gathered as much from looking through older Chrome bugs related to the new tab mechanism.

So, I understand that the whole redirect nature of my extensions creates an undefined race condition of highlighting the address bar.

A better representation of the feature request would be something like: https://github.com/jimschubert/duckduckgo-newtab. I created this extension 3 years ago as an example for users who wanted a simple customized new tab override without all the syncing and locking into trusting a random developer. At the time, the stable version of Chrome wouldn't load new tab extensions with http or https override pages. It appears to support non-chrome pages as of Chrome 60, with a simplified extension consisting only of a manifest.json the address bar is still not selected or highlighted as users would expect (see attached manifest.json).
manifest.json
313 bytes View Download
Cc: keerthan...@techmahindra.com
Labels: Needs-Triage-M62 Needs-Feedback Triaged-ET
Able to reproduce on reported version 62.0.3202.18  and issue seems to be fixed on latest canary 63.0.3219.0 with the mentioned steps below  on Ubuntu 14.04, windows and Mac 10.12.6.
1.Installed the New Tab Redirect Extension
2.Entered a redirect URL and clicked ""Save"". Checked the box ""Always update tab, not redirect. (Enable for cursor in the address bar)""
3.Opened a New tab. In M63, the URL is getting highlighted. Attaching the screenshot for reference.

@Reporter: Could you please check the same on latest canary and update. You can download canary builds from the below link https://www.chromium.org/getting-involved/dev-channel. 

766331.png
510 KB View Download
The URL highlighting is working for me in both 63.0.3219.0 and 62.0.3202.18. However, can we rely on this continuing to work?

This is a feature request, not a bug report, because the way Chrome extensions are currently replacing the new tab page with a web page feels like a workaround. I don't believe there are any official examples for how to do this. Historically, the URL highlighting behavior has been unreliable.

As mentioned in comment #1 - can this use case be clearly supported by Chrome extensions? Or, at the very least, can the Chrome team document that the `chrome.tabs.update` approach that extensions are using will reliably highlight the URL going forward?
Project Member

Comment 4 by sheriffbot@chromium.org, Sep 19 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "keerthana.v@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Type-Bug M-63 Type-Feature
Status: Untriaged (was: Unconfirmed)
Considering it as a feature request and marking it as untriaged for further inputs as per comment#3.

Thanks!
Labels: OS-Linux OS-Windows
Can we get an update on whether this feature is in consideration? Thanks!
Owner: yyushkina@chromium.org
Status: Assigned (was: Untriaged)
Triage: Related to issue 797916.

yyushkina@ has been thinking about things in this area.

Sign in to add a comment