Denying load of chrome-extension://(해당 extension id)/(정적 파일주소)

라니·2024년 3월 24일
0

troubleshooting

목록 보기
2/2
post-thumbnail

error message

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.

why?

기본적으로 resource에 웹이 access 할 수 없다.

악성 사용자가 설치된 확장 프로그램의 취약점(ex: XSS 버그)을 악용할 수 있기 때문!

그래서 manifest.json에서 혀용된 페이지 또는 스크립트만 확장프로그램의 resource에 access할 수 있다

solution

manifest.jsonweb_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
    }
  ],
  ...
}

reference

https://developer.chrome.com/docs/extensions/reference/manifest/web-accessible-resources?hl=ko

profile
강아지를 좋아합니다🐶

0개의 댓글