NewTab-Redirect
NewTab-Redirect copied to clipboard
Focus on URL bar after opening tab
It would be very, very nice if the URL would get focused when the new tab is opened, this way I can type right away an omnibar search (like a google search, for example)
See #46
I am leaving this open so other people can find it more easily.
Ty for responding so promptly. Is there something that can be done in the browser to get this done? Suggesting a patch to chromium exposing an api that lets extensions have control over the omnibar perhaps?
On Wed, Apr 2, 2014 at 11:55 AM, Jim Schubert [email protected]:
See #46 https://github.com/jimschubert/NewTab-Redirect/issues/46
I am leaving this open so other people can find it more easily.
Reply to this email directly or view it on GitHubhttps://github.com/jimschubert/NewTab-Redirect/issues/50#issuecomment-39340195 .
Marcio Ribeiro
Unfortunately, they consider exposing that functionality a security risk.
The browser randomly focuses or doesn't.
You can use CTRL+L to achieve the same thing... which probably puts this as a low priority for them anyway. On Apr 2, 2014 1:16 PM, "mmr775" [email protected] wrote:
Ty for responding so promptly. Is there something that can be done in the browser to get this done? Suggesting a patch to chromium exposing an api that lets extensions have control over the omnibar perhaps?
On Wed, Apr 2, 2014 at 11:55 AM, Jim Schubert <[email protected]
wrote:
See #46 https://github.com/jimschubert/NewTab-Redirect/issues/46
I am leaving this open so other people can find it more easily.
Reply to this email directly or view it on GitHub< https://github.com/jimschubert/NewTab-Redirect/issues/50#issuecomment-39340195
.
Marcio Ribeiro
Reply to this email directly or view it on GitHubhttps://github.com/jimschubert/NewTab-Redirect/issues/50#issuecomment-39357492 .
Wow, that ctrl-l shortcut totally made my day. Thanks a lot :)
On Wed, Apr 2, 2014 at 2:51 PM, Jim Schubert [email protected]:
Unfortunately, they consider exposing that functionality a security risk.
The browser randomly focuses or doesn't.
You can use CTRL+L to achieve the same thing... which probably puts this as a low priority for them anyway.
On Apr 2, 2014 1:16 PM, "mmr775" [email protected] wrote:
Ty for responding so promptly. Is there something that can be done in the browser to get this done? Suggesting a patch to chromium exposing an api that lets extensions have control over the omnibar perhaps?
On Wed, Apr 2, 2014 at 11:55 AM, Jim Schubert <[email protected]
wrote:
See #46 https://github.com/jimschubert/NewTab-Redirect/issues/46
I am leaving this open so other people can find it more easily.
Reply to this email directly or view it on GitHub<
https://github.com/jimschubert/NewTab-Redirect/issues/50#issuecomment-39340195
.
Marcio Ribeiro
Reply to this email directly or view it on GitHub< https://github.com/jimschubert/NewTab-Redirect/issues/50#issuecomment-39357492
.
Reply to this email directly or view it on GitHubhttps://github.com/jimschubert/NewTab-Redirect/issues/50#issuecomment-39361593 .
Marcio Ribeiro
Or if you prefer to do it with only your left hand: alt+d will do the same thing.
F6 works as well
On Sun, Apr 13, 2014 at 7:01 PM, Geert Smelt [email protected]:
Or if you prefer to do it with your left hand: alt+d will do the same thing.
Reply to this email directly or view it on GitHubhttps://github.com/jimschubert/NewTab-Redirect/issues/50#issuecomment-40321360 .
Marcio Ribeiro
I'd prefer that the omnibar would not get focused on when opening a new tab. This should be optional.
agree with Arvin. i prefer to have the keyboard not focused in the address bar. my homepage is set to google and i prefer to have the focus in the search box upon opening a new tab. hopefully this can be adjusted
How about removing the actual URL instead? every time I try typing in the URL bar after opening a new tab, it looks something like this: chrome://appsgoogle.com.... frustrating lol.
Extensions aren't able to interact with the address bar that way. You can use CTRL+L to highlight the text and just type over it.
The new built in apps page (remove the URL in New Tab Redirect's options and click save) doesn't have this problem because that's the default functionality for new tab override pages. The functionality is lost by the 'redirect'. On Apr 24, 2014 9:16 PM, "markentingh" [email protected] wrote:
How about removing the actual URL instead? every time I try typing in the URL bar after opening a new tab, it looks something like this: chrome://appsgoogle.com.... frustrating lol.
— Reply to this email directly or view it on GitHubhttps://github.com/jimschubert/NewTab-Redirect/issues/50#issuecomment-41350658 .
@Arvin109 and @ajschmidt8 The comment about cursor focus should be fixed in version 3.1.1 (related to issues #56 and #59).
This issue is about keyboard "focus" to highlight the contents of the address bar, which isn't possible. I realized just now that the label I applied used the same 'focus' terminology as when the issue was reported. I'll change that to 'highlight'.
The 3.1.1 fix should be available within a few hours.
Thank you for such a quick response, Jim! Ctrl+L is a good alternative, and I found that Ctrl+A also works to highlight the text since the address bar already has focus when opening a new tab.
@markentingh no problem. I've released version 3.1.1 that reverts the default cursor location back to in-page. If you want it to remain in the address bar (as it does in the bug), I added an option to the options page to use update only... just check and save. I use CTRL+L almost all the time. It's really helpful when you're done with a page to just CTRL+L and type to change the page.
I'd prefer that the omnibar would not get focused on when opening a new tab. This should be optional.
Again, this is functionality of the browser. I can't change it one way or the other. On Jun 14, 2014 1:12 AM, "greywolf272" [email protected] wrote:
I'd prefer that the omnibar would not get focused on when opening a new tab. This should be optional.
— Reply to this email directly or view it on GitHub https://github.com/jimschubert/NewTab-Redirect/issues/50#issuecomment-46078827 .
Another way to get the url selected after opening a new tab (or not have it show at all depending on how fast you do it) is to hit escape. It is quicker that ctrl + l and can have the desired effect of not showing the url at all if timed right.
Is there a way that you could have the extension send and esc after the tab opens?
Thanks for making this in the first place. It really helps me.
I, too, am frustrated by having to overwrite "chrome://apps" whenever I need to navigate to a new page.
Another idea that may help: the extension opens its own custom page with a large text box near the top auto-focused that you can type a URL or search term into, hit enter and very simple Javascript would redirect the tab to that URL.
Your custom new tab page setting would be in an iframe below, taking up the majority of the screen. I'm not sure if chrome://apps will open in an iframe like that under an extension's permissions, but seems like a pretty simple solution.
Of course all this should be behind an option for those that just want a simple new tab redirect :-)
Sounds like an interesting idea, have an option to put the URL into an iframe and a blank default page (other than the iframe) instead of redirecting the tab to the URL
you could have the iframe replace the apps?
Are there any updates on this? Or is it still not allowed? It's frustrating to do CTRL+T then CTRL+A or CTRL+L 😞
UPDATE: Wait, this seems to be working fine in regular Chrome, just not Chrome Canary?
This is still a limitation of the browser. Sometimes it's different between versions or operating systems. There's nothing that can be done from this extension. The issue is left open for visibility, not because it's a pending fix. Sorry
@jimschubert very interesting how it could change between versions of the same browser. I'll just use the extension on regular Chrome because it seems to be working beautifully and selecting the URL as requested.
Thanks!
Yeah it has to do with the two threading contexts in Chrome. The browser related tasks (which open new tabs) run on one thread while page related tasks (like this extension's redirect mechanism) run on another thread. The issue is that new tab override pages (this extension's context) are loaded in the browser-level threads, and given URL focus when technically loaded. This extension then redirects to your defined URL on the second thread, which has no access to focus the URL.
The reason it differs across versions, from what I could tell, is related to changes made in either of those threads. But it's also affected by how many extensions or so you have loaded, which need resources from the chrome-related thread pool.
Thanks so much for the reply, that's really interesting.
On Fri, Jul 14, 2017, 5:38 PM Jim Schubert [email protected] wrote:
Yeah it has to do with the two threading contexts in Chrome. The browser related tasks (which open new tabs) run on one thread while page related tasks (like this extension's redirect mechanism) run on another thread. The issue is that new tab override pages (this extension's context) are loaded in the browser-level threads, and given URL focus when technically loaded. This extension then redirects to your defined URL on the second thread, which has no access to focus the URL.
The reason it differs across versions, from what I could tell, is related to changes made in either of those threads. But it's also affected by how many extensions or so you have loaded, which need resources from the chrome-related thread pool.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jimschubert/NewTab-Redirect/issues/50#issuecomment-315474155, or mute the thread https://github.com/notifications/unsubscribe-auth/AFQDyk4VrfG-RzbDIc_neyJOsxiHRw7Wks5sN9_KgaJpZM4BvBJF .
--
Alex Bass
President & CEO CyberBytes Inc. cyberbytesinc.com // @alexhbass
Sent from Google Pixel
I'm using this extension from quite some time now and is very important in my daily routine working on Chrome browser. Recently after version 61 update the cursor in the address bar don't autoselect the text as it used to do earlier. It's bit annoying as I have to manually select the text in the address bar before typing any new text. Request you to kindly look into the bug and rectify at your earliest.
Look forward to your prompt support
Same here. Updated Chrome today and I'm on V61.
When I start a new tab the cursor is sent to the left of the address bar with my URL to the right. When i start typing my URL its followed by the original URL instead of its previous behaviour of being cleared.
Anything you can do to resolve?
I noticed the Chrome 61 issue, but in connection with my own (unpublished) new tab redirect extension. I agree it is annoying. My use case is where I load a file:/// page which contains my frequently accessed URLs (essentially a bookmarks page), but I sometimes just use it as a means to do a Google search in a new tab, hence having the address bar auto focus AND highlight the text so anything typed overwrites the URL is pretty helpful. There are a few keyboard shortcuts that'll highlight what's in the address bar (e.g. F6), but that's one extra keypress to slow the workflow down.
The problem in my extension seems to be connected with the use of chrome.tabs.update to perform the redirect. My workaround is to use document.location.replace(theUrl) instead to perform the redirect, and add "file:///" to the manifest to allow file:/// URLs. As an added bonus the workaround removes the back button history item, so it no longer appears as if the redirected page is the second page opened. The disadvantage is that the highlighting behaviour isn't exactly restored to its pre- Chrome 61 state; instead, the address bar isn't highlighted and the cursor is nowhere to be seen, just like you'd see after you typed the URL into the address bar manually and hit return.
For me this is an improvement on the cursor going to the left-most position in the address bar. What I found myself doing was googling for my search terms concatenated with the full file:/// path (obviously undesirable!). As a workaround for this I ended up embedding a Google search box in my file:/// page, and with some JS, auto-focussing on the input.
Of course without a redirect extension installed Chrome 61 behaves as before; the default new tab page's address bar is empty so having the cursor in the left-most position ready for input is not a problem.
I'd be interested to see the extension author's comments on this issue.
I don't have any additional comments other than what I've already made. This is an issue with how the browser decides to focus the address bar. All "solutions" I've made have only been hacks which don't work in every case or across platforms.
If you have a local HTML file which you'd like to be your new tab page, you can very easily create your own extension. The problem with address bar focus comes from redirecting to an http or https address.
I have an example extension which redirects to duckduckgo here: https://github.com/jimschubert/duckduckgo-newtab. Rather than modify override.html to point to some location, just replace override.html's contents with your redirect file's contents. Because the browser no longer needs to switch from the thread managing chrome (browser parts) to web parts, your address bar should automatically focus.
Perhaps it should have been a new post, but the issue I and the previous two posters are referring to is a specific change that came in just-released Chrome 61. I think this is distinct from discussions before it.
Anyway, thanks for the info regarding your duckduckgo extension, which I've adapted as you suggested. As before, the cursor is still focussed in the address bar. However with this method the address bar is empty, which avoids the undesirable situation I describe above where you end up doing a search of search terms + the full file path. As an added bonus, because no redirect occurs I reach my HTML page noticeable more quickly.
One disadvantage though, is that I keep the HTML file in my Dropbox folder so that I can load it as the new tab redirect page from another PC. Because this file content resides in override.html in the extension folder — %AppData%\Local\Google\Chrome\User Data\Default\Extensions\kgmhedbfjedjmnhpjolijbhghoaehdmk\1.0_0 — any edits to the HTML that I make are not synced across PCs. However, I've worked around this by removing override.html and creating a hard link called override.html, linking to the HTML file in my Dropbox folder.
The issue showing in Chrome 61 is just coincidence. It has randomly reappeared for users across different versions. Some users report newer versions of Chrome introducing the behavior while others report it being "fixed". In actuality, it has to do with sandbox logic and running the Redirect in a threadpool separate from that where browser events (new tab + rendering that page) occur. It seems like any additional logic of any kind may change the behavior. Although, users on the same OS and same Chrome version may consistently experience different behaviors.
Trust me, I understand it's frustrating. But I have no control over it, and I've combed through Chrome's source to see if there's a solution, which there's not.
@jimschubert You understand and know more than I. But is there no way of sending "ALT+D" or "CTRL+L" to the browser after opening a new tab a new tab through execute_browser_action
or execute_page_action
in the manifest after "chrome_url_overrides": { "newtab": "override.html" }
? Both execute_browser_action
or execute_page_action
seems to be for custom shortcuts but I guess there must be a command for sending chrome built shortcut. I am just brainstorming here. Thanks
Edit: I am referring to chrome_url_overrides
in your code https://github.com/jimschubert/duckduckgo-newtab