Denying load of chrome-extension://(해당 extension id)/(정적 파일주소) Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.
기본적으로 resource에 웹이 access 할 수 없다.
악성 사용자가 설치된 확장 프로그램의 취약점(ex: XSS 버그)을 악용할 수 있기 때문!
그래서 manifest.json
에서 혀용된 페이지 또는 스크립트만 확장프로그램의 resource에 access할 수 있다
manifest.json
의 web_access_resources
에 해당 파일의 주소를 추가한다.
ex)
{
...
"web_accessible_resources": [
{
"resources": [ "test1.png", "test2.png" ],
"matches": [ "https://web-accessible-resources-1.glitch.me/*" ]
}, {
"resources": [ "test3.png", "test4.png" ],
"matches": [ "https://web-accessible-resources-2.glitch.me/*" ],
"use_dynamic_url": true
}
],
...
}
https://developer.chrome.com/docs/extensions/reference/manifest/web-accessible-resources?hl=ko