The HTML file is not getting loaded through the extension in the application(end user side)

89 views
Skip to first unread message

Saurav Chaudhary

unread,
Sep 8, 2023, 10:56:08 AM9/8/23
to Chromium Extensions
Hi,

I have an extension within which I have some files present (html, .js, etc.). I am trying to load them at the end user side to execute some business logic. Respective changes have been made in the manifest file to load the files.  This extension is MV3 compatible.

I have hosted the extension through the Chrome Store and I see that the call that goes to load the file(HTML file) from the extension remains in the pending state and never gets the response back. Due to this, the js file(the HTML file is responsible for loading this) is not being injected into the application.

Please find the attached snapshots for reference below.

If I use the same extension without hosting it on the Chrome store and just directly add it in the Chrome extensions section in the Chrome web browser, it works as expected.

Please let me know if you need any more details on this. Any help here would be much appreciated.
Screenshot 2023-09-08 at 8.17.20 PM.png
Screenshot 2023-09-08 at 8.16.57 PM.png

wOxxOm

unread,
Sep 9, 2023, 5:01:40 AM9/9/23
to Chromium Extensions, Saurav Chaudhary
Show your code that loads this file and web_accessible_resources section in your manifest.json.

Saurav Chaudhary

unread,
Sep 11, 2023, 2:39:21 AM9/11/23
to Chromium Extensions, wOxxOm, Saurav Chaudhary
I am injecting an iframe with in the application body having src equals to the path the file where it is present with in the extension.
Hence, src looks like -> chrome-extension://fmnekaohfdemlbamgflhpdkdioadkmsd/main/file/tmSandbox.html

web_accessible_resources section looks like this -
"web_accessible_resources":[
      {
         "resources":[
            "/main/file/*"
         ],
         "matches":[
            "*://*/*"
         ]
      }
   ]



tmSandbox.html file looks like this -
<html>
<head>
<script src="tmSandbox.js" type="text/javascript" async="true"></script>
</head>
</html>


Do you see anything wrong here?

wOxxOm

unread,
Sep 11, 2023, 2:45:41 AM9/11/23
to Chromium Extensions, Saurav Chaudhary, wOxxOm
Looks fine, so assuming you use chrome.runtime.getURL and not a hard-coded id that maybe different in the web store, indeed there may be a bug in Chrome. You can report it in https://crbug.com.

mik...@tsunada.co.jp

unread,
Sep 11, 2023, 2:49:07 AM9/11/23
to chromium-...@chromium.org

Please don't send it again

--
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/98d76cfc-3d62-4f8d-934d-233994a5766an%40chromium.org.

Saurav Chaudhary

unread,
Sep 11, 2023, 3:08:46 AM9/11/23
to Chromium Extensions, wOxxOm
Other files like javascript files are getting loaded through web store without having any issues. So, it doesn't seem to be related to URL issue. Anyway, thank you for your responses, will raise a bug with chrome.
Reply all
Reply to author
Forward
0 new messages