Skip to content

Commit

Permalink
fix: Update manifest.json to allow rikaikun to work in srcdoc iframes. (
Browse files Browse the repository at this point in the history
#411)

Documented here: https://developer.chrome.com/docs/extensions/mv3/content_scripts/ but that page doesn't mention srcdoc. Essentially srcdoc is a way to inject html into an iframe and as such it doesn't have a `src` attribute. In this case, chrome treats the `src` attribute as `about:blank` which means without this option these types of frames won't have rikaikun injected into them.

This stackoverflow is a great overview and also implies that the documentation used to be better:
https://stackoverflow.com/questions/41408936/can-anyone-explain-that-what-is-the-use-of-match-about-blank-in-chrome-extensi

Inspired by birchill/10ten-ja-reader@946b3aa

Fixes #410
  • Loading branch information
melink14 authored Apr 28, 2021
1 parent 327eecd commit 093824b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*", "ftp://*/*", "file:///*"],
"match_about_blank": true,
"js": ["rikaicontent.js"],
"all_frames": true
}
Expand Down

0 comments on commit 093824b

Please sign in to comment.