chrome.tabs.executeScript not working on chrome v99

261 views
Skip to first unread message

Rory

unread,
Mar 2, 2021, 10:43:25 PM3/2/21
to Chromium Extensions
Hi,

I have a chrome plugin where this line has been working fine until now.

With the new update, I get this error in the console for the service worker (attached).

Has this function been deprecated? Am I implementing wrong? I can't see anything in the documentation about deprecation.

This is the code that I'm using:

https://pastebin.com/fA3eHd8u
Screen Shot 2021-03-02 at 7.41.52 PM.png

Rory

unread,
Mar 2, 2021, 10:43:58 PM3/2/21
to Chromium Extensions, Rory
Worth noting also: I am using manifest v3.

George Henderson

unread,
Mar 2, 2021, 10:57:52 PM3/2/21
to Rory, Chromium Extensions
It has been replaced with chrome.scripting which requires a new “scripting” permission. See https://developer.chrome.com/docs/extensions/reference/scripting/

--
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/a1fb40ae-05de-4aa0-863f-191f74de3d6cn%40chromium.org.

Rory

unread,
Mar 2, 2021, 11:01:37 PM3/2/21
to Chromium Extensions, georgehend...@gmail.com, Chromium Extensions, Rory
Thanks for the information George. Is there somewhere I should be reading to stay up to date with deprecations like this? I didn't hear about this anywhere.

Rory

unread,
Mar 2, 2021, 11:04:36 PM3/2/21
to Chromium Extensions, Rory, georgehend...@gmail.com, Chromium Extensions
Hi George + Chrome team,

I just switched this across, changed my code accordingly and added the relevant permissions.

When I loaded the plugin in dev mode it completely crashed chrome instantly and the browser restarted.

Is there a different API I could use until this one or version 99 is more stable?

Thank you,
Rory

George Henderson

unread,
Mar 2, 2021, 11:05:31 PM3/2/21
to Rory, Chromium Extensions
I think the first time I stumbled upon it was reading open issues on crbug for chromium related to MV3. There are some docs that have some general guidance on deprecated methods. This page is worth reading if you haven’t seen it yet. https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/

Rory

unread,
Mar 2, 2021, 11:07:24 PM3/2/21
to Chromium Extensions, georgehend...@gmail.com, Chromium Extensions, Rory
Thank you.

I'm unable to run this code without chrome instantly crashing. Chrome panics any time I try to load my plugin in and crashes.


This is the code. Is my implementation wrong? Chrome should be throwing an error at the very least instead of just crashing.

I've also added the relevant scripting permission to my manifest file.

Rory

unread,
Mar 2, 2021, 11:12:26 PM3/2/21
to Chromium Extensions, Rory, georgehend...@gmail.com, Chromium Extensions
Actually, seeing as this is a new error, I should probably make a new thread.

Jackie Han

unread,
Mar 4, 2021, 4:50:05 AM3/4/21
to Rory, Chromium Extensions, georgehend...@gmail.com
I add a new feature request for documents: add MV2,MV3 or ALL flags to API Reference

Rory <rorygar...@gmail.com> 于2021年3月3日周三 下午12:12写道:


--
Jackie Han
Reply all
Reply to author
Forward
0 new messages