SCBao/background.js

11 lines
366 B
JavaScript

chrome.runtime.onInstalled.addListener(() => {
chrome.storage.local.get("replacements", (data) => {
if (!data.replacements) {
fetch(chrome.runtime.getURL("replacements.json"))
.then((response) => response.json())
.then((json) => {
chrome.storage.local.set({ replacements: json });
});
}
});
});