새오의 개발 기록

크롬 확장프로그램 다른 사이트의 로컬 스토리지 데이터 가져오기 본문

프로젝트

크롬 확장프로그램 다른 사이트의 로컬 스토리지 데이터 가져오기

새오: 2022. 10. 3. 23:21

크롬 확장프로그램 로컬 스토리지를 구글링해보면

전부 접속해있는 사이트의 로컬 스토리지나

확장 프로그램 내의 로컬 스토리지에 대해서만 다루고 있다.

 

내가 필요한 건 지금 접속해있지 않은 도메인의 로컬스토리지이다.

기본적으로 로컬 스토리지는 도메인 마다 생긴다는 것을 알고 있어야 한다.

 

 

Cross-Domain LocalStorage

As you may know, LocalStorage is domain based. You can’t read or write from localstorage that’s on different domain, even if that’s subdomain. But there is iframe trick that you c…

jcubic.wordpress.com

오랜 구글링 끝에 찾은 내용

"how to get other domain's localstorage"라고 찾으니 나온다..

 

근데 코드랑 설명 봐도 모르겠음

 

https://stackoverflow.com/questions/15288648/chrome-extension-write-to-local-storage-of-a-different-domain

 

Chrome extension - Write to local storage of a different domain

How can I write to a local storage of a different domain. The idea is that I need my chrome extension to write something in the local storage and when the user visits the associated website, site s...

stackoverflow.com

 

 

스크립트를 주입하는 방식으로 가능한 것 같은데

이런 방법이라면 무조건 탭이 한번은 열리긴 해야되는 조건인 것 같다.

그건 사용자한테 혼란을 줄 것 같아서 좋지 않은 방법인데..

 

 

 

https://blog.naver.com/pjt3591oo/220894012617

 

[chrome extension] 웹 페이지로 부터 얻은 데이터를 확장 프로그램에 띄어주기

스크립트 인젝션을 통해 웹 페이지의 데이터를 확장프로그램에서 띄어주는 것을 알아보았다. 확장 프로그램...

blog.naver.com

 

이거 참고해서 내일 닷 해봐야겠다