1
Fork 0
mirror of https://github.com/Steffo99/chakra-magic.git synced 2024-10-16 06:27:27 +00:00

Merge pull request #2: Make script compatible on both Firefox and Chrome

This commit is contained in:
Steffo 2019-10-02 10:48:52 +02:00 committed by GitHub
commit 1177182df1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 9 deletions

View file

@ -1,7 +1,11 @@
let thisBrowser = null;
if(!thisBrowser) try { thisBrowser = browser; } catch(e) {}
if(!thisBrowser) try { thisBrowser = chrome; } catch(e) {}
function openPage() {
browser.tabs.create({
thisBrowser.tabs.create({
url: "https://steamcommunity.com/my/gcpd/570/?category=Account&tab=MatchPlayerReportIncoming"
});
}
browser.browserAction.onClicked.addListener(openPage);
thisBrowser.browserAction.onClicked.addListener(openPage);

View file

@ -94,15 +94,13 @@ function chakraMagic() {
let chakraElement = document.createElement("button");
parentElement.appendChild(chakraElement);
chakraElement.setAttribute("onclick", "illuminate()")
chakraElement.setAttribute("class", "chakramagic-button")
chakraElement.onclick = illuminate;
chakraElement.setAttribute("class", "chakramagic-button");
let imageElement = document.createElement("img")
let imageElement = document.createElement("img");
chakraElement.appendChild(imageElement);
imageElement.setAttribute("src", "http://cdn.dota2.com/apps/dota2/images/abilities/keeper_of_the_light_illuminate_hp2.png");
imageElement.setAttribute("class", "chakramagic-image")
exportFunction(illuminate, window, {defineAs: "illuminate"});
imageElement.setAttribute("class", "chakramagic-image");
}
chakraMagic();

View file

@ -8,7 +8,7 @@
},
"name": "Chakra Magic",
"version": "2019.9.30.2",
"version": "2019.10.2.1",
"developer": {
"name": "Stefano Pigozzi",
"url": "https://github.com/Steffo99/chakra-magic"