728x90
๋ฐ์ํ
1) ๊ถํ ์ค์
"permissions": ["storage"]
2) ๋ฐ์ดํฐ ์ง์
chrome.storage.sync.set({ userData: user });
3) ๋ฐ์ดํฐ ๊ฐ์ ธ์ค๊ธฐ
chrome.storage.sync.get(["userData"], result => {});
์ฌ์ฉ ์์)
async function loadSecNvMids(){
return new Promise( (resolve, reject)=>{
chrome.storage.sync.get(["secNvMids"], result => {
resolve( result );
});
} )
}
async function main(){
var secNvMids = null;
secNvMids = await loadSecNvMids();
secNvMids = secNvMids.secNvMids;
};
background js์์๋ chrome.storage๋ฅผ ์ด์ฉํ ์ ์์
์ถ์ฒ:
์น ๊ฐ๋ฐ ๊ธฐ์ ๋ธ๋ก๊ทธ
์น ๊ฐ๋ฐ์ ํ์ํ ์ง์์ ๊ธฐ๋กํ๋ ๋ธ๋ก๊ทธ์ ๋๋ค.
13akstjq.github.io
https://gist.github.com/sumitpore/47439fcd86696a71bf083ede8bbd5466
Chrome's Local StorageArea API in Synchronous way for use in Chrome extensions. Replace 'chrome.storage.local' by 'chrome.storag
Chrome's Local StorageArea API in Synchronous way for use in Chrome extensions. Replace 'chrome.storage.local' by 'chrome.storage.sync' if you want to use Sync StorageArea - chr...
gist.github.com
728x90
๋ฐ์ํ
'๐จ๐ผโ๐ป๊ฐ๋ฐ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๊ฐ๋ฐ - IP ์ฃผ์ text, json ํํ๋ก ์์ฒญ(ipify, ipinfo) (0) | 2022.09.01 |
---|---|
๊ฐ๋ฐ - ๋ฒ์ ํ๊ธฐ ๋ฐฉ๋ฒ (1) | 2022.08.31 |
๊ฐ๋ฐ - ์จ๋ผ์ธ ์ปดํ์ผ๋ฌ (0) | 2022.08.11 |
์ฝ์์ฐฝ ๋ฐ๋ก ๊บผ์ง์ง ์๊ฒ ๋ฐฉ์งํ๊ธฐ (0) | 2022.05.15 |
ํด๋ผ์ฐ๋์ ๋ฌด๋ฃ๋ก ์์ค์ฝ๋ ๋ณด๊ดํ๊ธฐ(pastebin.com) (0) | 2021.12.13 |