Extension no longer working in Chrome 118

805 views
Skip to first unread message

Mark Williamson

unread,
Oct 26, 2023, 10:15:57 AM10/26/23
to Chromium Extensions

Hi,

 

I use a v2 Chrome extension to implement some features in our software. At a high level the workflow involves sending the web page a user is navigating to to a Windows service, that goes through our rules engine and then a response sent back instructing the extension to redirect to a different web page if required. This redirection is done via the Chrome.tabs.update API.

Our extension is loaded via an enterprise app store. This is not a new feature and has been in our software and has worked this way for many years.

In Chrome 118, the extension is loaded correctly. It also successfully sends the web pages a user is visiting to our agent. It does not load the new (redirected) page when instructed to do so.

If I use the manifest and js files directly (via ‘load unpacked’ when in developer mode) then it does work as expected.

 

Looking in the https://chromestatus.com/roadmap and other sites listing the features\changes in 118, I can not see anything obvious related to what I am seeing. The only similar thing was Enhanced Protection under Safe Browsing. I set my Safe Browsing to ‘No Protection’ to see if that made a difference. It dd not.

 

Any advice greatly appreciated.

Patrick Kettner

unread,
Oct 26, 2023, 10:19:48 AM10/26/23
to Mark Williamson, Chromium Extensions
Hi Mark
Im sorry to hear about that. There isn't a ton to go on from what you said. Have you tried checking the console for the extension when it is in production mode to see if there are any errors listed?

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/c2c049df-2436-4cd0-8f12-04642375584an%40chromium.org.

Mark Williamson

unread,
Oct 26, 2023, 11:41:38 AM10/26/23
to Chromium Extensions, Patrick Kettner, Chromium Extensions, Mark Williamson
Thanks for you quick response Patrick,

I have looked at the console and there are no errors listed there. 

I enabled verbose logging in Chrome and  I have located the problem. Chrome logs in both 117 and 118 have a very similar trace, I can see the URL being navigated to in my onBeforeNavigate listener, and then see the response from my agent coming in telling the extension to redirect to a different URL. That results in a call to Chrome.tabs.update. I actually redirect to a file on disk. In the working log I then see this:

[10792:9804:1026/153901.040:VERBOSE1:file_url_loader_factory.cc(452)]

In the none working log I see this:

Unchecked runtime.lastError: Cannot navigate to a file URL without local file access.

That error is pretty clear in that my extension needs to request access to the local file system . Was there some change in 118 that tightened this up - perhaps I was getting away with this is 117 and earlier for some reason? What do I need to do in order to give my extension access to the local file system?

Thanks

Patrick Kettner

unread,
Oct 26, 2023, 11:52:06 AM10/26/23
to Mark Williamson, Chromium Extensions
Ah! That makes the issue much clearer. Yes, Chrome 118 removed the ability to redirect to files (notification here). If the extension is being force installed via policy, you have the ability to enable to behavior by setting the `file_url_navigation_allowed` in the extensions specific policy 

e.g.

{
  "{{extensionID}}": {
    "file_url_navigation_allowed": true,
    "installation_mode": "force_installed"
  }
}

Mark Williamson

unread,
Oct 26, 2023, 11:59:03 AM10/26/23
to Chromium Extensions, Patrick Kettner, Chromium Extensions, Mark Williamson
Great, thanks for the update and the code sample. 

Mark Williamson

unread,
Oct 30, 2023, 7:58:55 AM10/30/23
to Chromium Extensions, Mark Williamson, Patrick Kettner, Chromium Extensions

Hi,

 

I am struggling to get the file_url_navigation_allowed option to take effect. In our setup, we use our windows service to configure the relevant registry keys, namely the ExtensionInstallForceList (under each users HKCU) and NativeMessageHosts (under HKLM\Software\Google\Chrome).

 

It’s not clear to me where the Extension Settings value is configured, I have seen some conflicting documentation and have tried multiple variations with no success.

 

I have tried:

 

HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions\<extension id>

REG_SZ: file_url_navigation_allowed

Value: true

 

Same as above but with a DWORD

Same as above but under HKCU

 

HKCU\SOFTWARE\Policies\Google\Chrome\ExtensionSettings

REG_SZ: (Default)

Value: { "<extension id>": { "file_url_navigation_allowed": true}}

 

 

HKCU\SOFTWARE\Policies\Google\Chrome\ExtensionSettings\<extension id>

REG_SZ: file_url_navigation_allowed

Value: true

 

Same as above but with a DWORD

Same as above but under HKCU

 

I have also tried adding

"file_url_navigation_allowed": true,

To the list of properties in my manifest.json, alongside name, description, update_url etc


Hopefully you can provide the correct location for this setting.  


Thanks

Patrick Kettner

unread,
Nov 2, 2023, 2:29:39 PM11/2/23
to Mark Williamson, Chromium Extensions
What version of Chrome are you testing in?

Mark Williamson

unread,
Nov 3, 2023, 6:55:20 AM11/3/23
to Chromium Extensions, Patrick Kettner, Chromium Extensions, Mark Williamson
Hi Patrick,

Thanks for following up. 

After a couple of frustrating days I realised the fix I required wasn't implemented until 119 - despite the (for me) breaking change going in 118. Still, 119 will be here soon. 
For others with the same problem coming to this thread, the actual registry changes are

HKLM\Software\Policies\Google\Chrome
REG_SZ: ExtensionSettings
Value: { "<extensionid>": { "file_url_navigation_allowed": true}}

Just be aware that other extensions can use this key, as well as '*' that applies to all.
The same key under HKEY_USERS\<user sid> can also be used.

I appreciate Edge is the competition but i'll ask anyway. Do you believe Edge will stay in lockstep in terms of Chromium updates and so this change should also be in Edge 119? I treid the 119 beta (and 120 developer build) neither had the fix in yet. The Edge forums are a bit of a wild west compared to here and my question remains unanswered after a couple of days. It wouldn't surprise me if I get an answer here about Edge before the Edge forums tbh :)

Thanks

Patrick Kettner

unread,
Nov 3, 2023, 7:09:00 AM11/3/23
to Mark Williamson, Chromium Extensions
> Do you believe Edge will stay in lockstep in terms of Chromium updates and so this change should also be in Edge 119?
Yes, they are already shipping the chromium version with the update in the prerelease channels.

Mark Williamson

unread,
Nov 3, 2023, 1:50:40 PM11/3/23
to Chromium Extensions, Patrick Kettner, Chromium Extensions, Mark Williamson
I appreciate the answer re Edge however I am unfortunately not seeing that. . 

I tried the Canary build (120.0.2200.0) and get the following:

ErrorError at ExtensionSettings.ckbkaheaneikcbolbcpldmpmbenjkhci: Schema validation error: Unknown property: file_url_navigation_allowed

Thanks. 

Liam Read

unread,
Dec 16, 2024, 8:48:56 AM12/16/24
to Chromium Extensions, Mark Williamson, Patrick Kettner, Chromium Extensions
Hi,

We're experiencing the exact same issue, we've set the file_url_navigation_allowed to true however it doesn't enable it in the extension so it doesn't get local url access. I'm on Version 131.0.6778.140

extensionsettings.png
extensionsettings1.png

Reply all
Reply to author
Forward
0 new messages