Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
171 views
in Technique[技术] by (71.8m points)

Extension injection of content script into worker

With the recent release of manifest v3, background scripts are moving to server workers (https://developer.chrome.com/docs/extensions/mv3/migrating_to_service_workers/) but I didn't read anything that says that content scripts will finally be able to be injected into new workers created on a page. This is a shortcoming of current extension design (IMO) and I'm not entirely sure why Google and Mozilla do not make it possible.

There is at least one question from a few years back that addresses this and the only answer is to override the Worker constructor.

Chrome extension: script injection to workers and other nonpages

That's not an ideal solution and I'm not clear how to even inject my content script if I do override the constructor (any hints would be helpful).

Is content script injection into workers possible now (as of Feb 2021) or will be with the roll-out of manifest v3? @wOxxOm I'm hoping you have some insight.

question from:https://stackoverflow.com/questions/66057594/extension-injection-of-content-script-into-worker

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...