Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion background.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chrome.runtime.onInstalled.addListener(function () {
pageUrl: { hostEquals: 'app.roll20.net' }
})
],
actions: [new chrome.declarativeContent.ShowPageAction()]
actions: [new chrome.declarativeContent.ShowAction()]
}]);
});
});
13 changes: 7 additions & 6 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
"name": "Pixels on Roll20",
"version": "0.1",
"description": "Bring the magic of Pixels into Roll20!",
"permissions": ["activeTab", "declarativeContent", "storage"],
"permissions": ["activeTab", "declarativeContent", "storage", "scripting"],
"background": {
"scripts": ["background.js"],
"persistent": false
"service_worker": "background.js"
},
"page_action": {
"action": {
"default_popup": "popup.html",
"default_icon": {
"64": "images/logo-64.png"
Expand All @@ -16,6 +15,8 @@
"icons": {
"64": "images/logo-64.png"
},
"options_page": "options.html",
"manifest_version": 2
"options_ui": {
"page": "options.html"
},
"manifest_version": 3
}
8 changes: 5 additions & 3 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
// Inject code in website
// We need to be running in the webpage context to have access to the bluetooth stack
chrome.tabs.query({ active: true, currentWindow: true }, tabs => {
chrome.tabs.executeScript(
tabs[0].id,
{ file: "roll20.js" },
chrome.scripting.executeScript(
{
target: { tabId: tabs[0].id },
files: ["roll20.js"]
},
_ => {
sendMessage({ action: "getStatus" });
chrome.storage.sync.get('formula', data => sendMessage({ action: "setFormula", formula: data.formula }))
Expand Down