开发者

Cannot link to chrome://newtab

I'm trying to provide a link to chrome://newtab (the new tab page) for my distraction-preventing page for when I need to access it, however clicking the link gives the error Failed to load resource.

I've tried:

  • Linking to it using <a href="chrome://newtab">
  • Attempting to redirect the user using window.location.
  • The chrome: prefix aliases to chro开发者_JAVA技巧me:// but still fails to load.

Does anyone know if this is possible or has any ideas to try?


I am not sure why it doesn't work, but I think it is for security reasons.
Pages on the internet should not have access to local resources and the new tab page is a local resource.


Format your link thusly (also will work with firefox and other tabbed browsers):

<a href="about://blank" target="_blank">Click me</a>

EDIT: of course, that's not actually the new tab page. It's just a blank tab. Going to leave it anyways.


I think you'll have to write a Chrome extension to get access to the chrome://newtab link, it doesn't seem possible for an ordinary webpage to access it.


Edit: This solution no longer works, but I'll leave it for anyone that might try to hunt down why it stopped working.


I finally found that https://www.google.com/_/chrome/newtab will open chrome://newtab, thanks to this post.

Don't ask me why.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜