jimschubert/NewTab-Redirect

Chrome Beta 118 restricted access to a local file in "New Tab Redirect"

Edddy opened this issue Β· 30 comments

Edddy commented

I have a local html file as my redirect URL
image

But now, in Beta 118, local file access is restricted
image

I don't know if this can be solved

Same problem here. On 118 official version.

The option "Allow access to file URLs" is missing in version 118, so you can't switch it on. I reported it to Google.

578852275_Enpass-ChromeExt jpg 5d47e261d2b93401426f8eb0e6d9f9f7

Same problem too

Update:
I have been using this extension plugin to redirect new tabs to my local html files, but now I have upgraded my local html directory to a "Chrome Extension" and enabled developer mode to load it. Perhaps I will no longer need this extension anymore going forward. Thank you to this plugin for all the help until now.

Hi, I have the same problem too. No option to "Allow access to file URLs". Love this extension, hope there's a fix soon by Google Chrome.

Same problem here. Very annoying when you're so used to it. The option to switch access is missing here too. Is there any workaround? Registry perhaps.

Is there any workaround?

Not a complete workaround but in Chrome settings I clicked "Show Home button" and added my custom home page link into the custom web page field. That means when I open a new tab, it still shows a blank page but clicking the Home icon brings up my custom home page.

See https://support.google.com/chrome/answer/95314

Temporary solution to open a file on a new tab:

Instead of using the + sign to open a new tab, click the home page button (where you put your file) while you press the control key.

talesh commented

Hi @jark006 can you give some more details on how you achieved this for a noob? After adding manifest.json to the directory, how do you ensure that the HTML file from that directory always shows up on new tabs?

Update: I have been using this extension plugin to redirect new tabs to my local html files, but now I have upgraded my local html directory to a "Chrome Extension" and enabled developer mode to load it. Perhaps I will no longer need this extension anymore going forward. Thank you to this plugin for all the help until now.

AlSUit commented

Hello, @Edddy

Just add to manifest host permissions

"host_permissions": ["file:///*", "*://*/*"],

Thank you for your plugin!

@AlSUit Hi.
Where is the location of the manifest you are refering? Can you let us know the folder location?

AlSUit commented

@Mitchell-kw-Lee
In the file https://github.com/jimschubert/NewTab-Redirect/blob/master/manifest.json add "host_permissions" in root of json

...
"permissions": ["storage", "chrome://favicon/"],
"host_permissions": [
		"file:///*",
		"*://*/*"
	],
  "icons": {
    "200": "images/icon200.png",
    "128": "images/icon128.png",
	"19":"images/icon19.png"
  },
...

@AlSUit Thanks...
but reason why I ask you was...not working for me..
I expect local html loaded when I launch the browser. But still white blank page.
Me, something missing?

AlSUit commented

@Mitchell-kw-Lee
My solution is to update this plugin.

Or you can create your own extension

  • create folder with your file local.html
  • add manifest.json
{
    "manifest_version": 2,
    "name": "Home Page",
    "description": "Home page in new tab",
    "version": "1.0",
    "chrome_url_overrides": {
      "newtab": "local.html"
    }
  }

And using development mode in Chrome, upload your folder as extension.
That's it

@AlSUit Thanks, will figure it out myself based on your comment.

To all users, for the record.

To fix the matter,
replace the 'manifest.json' as below. Not only change the host* things above.

{
"background": {
"service_worker": "js/background.js"
},
"chrome_url_overrides": {
"newtab": "main.html"
},
"description": "Allows a user to provide the URL of the page that loads in a new tab.",
"icons": {
"128": "images/icon128.png",
"19": "images/icon19.png",
"200": "images/icon200.png"
},
"incognito": "split",
"manifest_version": 3,
"minimum_chrome_version": "22",
"name": "MY OWN Redirect",
"optional_permissions": [ "tabs", "topSites", "management", "bookmarks" ],
"options_page": "options.html",
"permissions": [ "storage"],
"host_permissions": ["file:///", "file://", ":///*"],
"short_name": "NTR!",
"version": "1.0.0"
}

To reload the changed manifest,
click the refresh icon in the extension manager page which is small circle icon
or
find out EVERY the manifest.json file in somewhere temp folders as well. Search it.
Me,
copy entire the extesion folder and change the manifest as above, and import it by no compression extension option in the Developer Mode on.
So I have own one.

Or you can create your own extension

  • create folder with your file local.html
  • add manifest.json
{
    "manifest_version": 2,
    "name": "Home Page",
    "description": "Home page in new tab",
    "version": "1.0",
    "chrome_url_overrides": {
      "newtab": "local.html"
    }
  }

And using development mode in Chrome, upload your folder as extension. That's it

I've done this to create my own extension which is then added to Chrome (via "Load Unpacked") and works perfectly, thanks @AlSUit ! :)

Hi @jark006 can you give some more details on how you achieved this for a noob? After adding manifest.json to the directory, how do you ensure that the HTML file from that directory always shows up on new tabs?

Update: I have been using this extension plugin to redirect new tabs to my local html files, but now I have upgraded my local html directory to a "Chrome Extension" and enabled developer mode to load it. Perhaps I will no longer need this extension anymore going forward. Thank you to this plugin for all the help until now.

Here is my manifest.json:

{
   "chrome_url_overrides": {
      "newtab": "NewTab.html"
   },
   "default_locale": "zh_CN",
   "description": "JARK006's personal NewTab",
   "icons": {
      "128": "NewTab_img/icon128.png",
      "96": "NewTab_img/icon96.png",
      "32": "NewTab_img/icon32.png"
   },
   "manifest_version": 3,
   "name": "JARK_NewTab",
   "version": "1.5"
}

More deteils see https://github.com/jark006/NewTab

talesh commented

Hi @jimschubert I created a pull request to resolve this issue encountered in the latest version of Chrome based on the recommendations from everyone in this thread.

another extension i use, i tab new tab, has the "allow access to file urls" option

I face the same issue and could not use the solutions suggested above.
This is the content of my manifest.json

image

@CraneRewind
That one works fine in the main browser window… but it doesn't work in Incognito Mode at all. Even with "Allow in Incognito" enabled, it simply doesn't work.

This one works perfectly for me.

https://chrome.google.com/webstore/detail/fast-new-tab-redirect/ohnfdmfkceojnmepofncbddpdicdjcoi

It doesn't bother me that it doesn't work in Incognito, as I don't browse logged into Google and I also use a History wipe extension as well.

Hi @jimschubert I created a pull request to resolve this issue encountered in the latest version of Chrome based on the recommendations from everyone in this thread.

Thanks @talesh! Just patched manifest.json using your pull request ( #220 ) and I'm back in business.

I love this plugin and have been using it for years...but there hasn't been a commit since Jan of 2020 which makes me wonder if @jimschubert will accept the pull request. It would be great if we could just update the plugin and be back to where we were before 118. 🀞

Yeah after using the new manifest.json, it works initially, but then the extension acts as if it's not installed and then doesn't work.
I've tried replacing the json in the extension's folder, and installing the extension manually with the edited json and neither work.
Can't someone just make a working fork and do link us here?

I love this plugin and have been using it for years...but there hasn't been a commit since Jan of 2020 which makes me wonder if @jimschubert will accept the pull request.

I've submitted to the webstore, but Google has turned extension management into a shitshow. I was unable to submit for the longest time because I was on manifest v2 and refused to move to manifest v3 (which I still believe is Google's way of reducing the ability of extensions to block ads, and I full disagree with it). One of Google's employees contributed to move this to manifest v3, so I guess I didn't really have any excuse after his contribution.

If manifest v3 does end up making it so you can't use ad blockers, look into DNS-based ad blockers like CloudFlare or AdGuard. This extension doesn't do anything with ad blocking, it just really gets on my nerves that Google collects and sells so much data. The Chrome Web Store used to be littered with extension developers doing the same. At least they're locking that down, so maybe the stories about their intent with manifest v3 weren't true.

A rant, feel free to skip

I moved to Firefox like 3 years ago, so maintaining this extension and all the hate mail and vitriol that comes with it every time I push an update isn't on the top of my priorities list. Like, I will literally get 50 emails calling me a "hacker" and threatening litigation because the extension works so well that people forgot they installed it in 2010. While laughable, being bombarded with those kinds of emails takes a toll - so much so that I've also mostly stopped checking my email. A consequence of that is that I don't get notified of issues/PRs. Even when I do get notified, my family takes 100% precedence over tinkering with open source which users are just going to complain about, and this leads to situations like Patrick bumping this project to manifest v3 in July and me having better things to do between July and October.

New Tab Extensions

I wouldn't recommend moving to just some other random new tab page. Although Google makes you "attest" that you're not selling user data, I don't trust literally any extension developers after being taken advantage of by multiple well-known extensions. It might seem funny coming from someone who also hosts a "well-known extension". But I wrote this extension in a weekend to play around with the Chrome API, then updated it a few times to play around with certain technologies or ideas for project structure. Then, around the same time manifest v3 was made available, the Chrome Web Store stopped letting me update. It has worked only after upgrading to the forced manifest v3 requirement contributed by Patrick.

Maintaining this extension

One thing that I'll say Google has finally done right after nearly 15 years is that they now require justifications for permissions required of users (something I implemented in this extension years ago).

However, it says it will literally take weeks for Google to do a manual review. I guess fingers crossed the two community contributions didn't screw something up? lol

Screen Shot 2023-10-23 at 10 27 31 PM Screen Shot 2023-10-23 at 10 21 48 PM

If Google would ever make extension management easier, I would update this extension more. But they don't support any sort of automation for testing, meaning every small change I make or accept needs to be fully manual tested. They also don't allow for API based publishing - so I can't use CI/CD. Again, that whole process is manual as well. My family and personal well-being will always come before manual testing and modifications of an extension for a browser which I don't personally use.

The option "Allow access to file URLs" is available now, so it can be switched on for this extension.

The option "Allow access to file URLs" is available now, so it can be switched on for this extension.

Excellent! New Tab Redirect now reinstalled and working. :)

I've added the new steps for enabling local file access to the readme: https://github.com/jimschubert/NewTab-Redirect/blob/master/README.md#missing-local-files