Split popup script into separate file
After testing found that in-line javascript is discouraged due to security policy settings, so split that into a separate file.main
parent
ce720da6fd
commit
1b7ad15d06
|
@ -31,7 +31,7 @@
|
||||||
],
|
],
|
||||||
"web_accessible_resources": [
|
"web_accessible_resources": [
|
||||||
{
|
{
|
||||||
"resources": [ "icons/sgdb_16.png", "icons/nes_32.png" ],
|
"resources": [ "icons/sgdb_16.png" ],
|
||||||
"matches": [ "*://store.steampowered.com/app/*", "*://steamcommunity.com/app/*" ]
|
"matches": [ "*://store.steampowered.com/app/*", "*://steamcommunity.com/app/*" ]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
13
popup.html
13
popup.html
|
@ -41,20 +41,11 @@
|
||||||
height: 22px;
|
height: 22px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script src="popup.js" defer></script>
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
|
||||||
const headerIcon = document.querySelector("#sgdb-icon");
|
|
||||||
const nesIcon = document.querySelector("#nes-icon");
|
|
||||||
const giteaIcon = document.createElement("#gitea-icon");
|
|
||||||
headerIcon.src = browser.runtime.getURL("icons/icon_32.png");
|
|
||||||
nesIcon.src = browser.runtime.getURL("icons/nes_32.png");
|
|
||||||
giteaIcon.src = browser.runtime.getURL("icons/gitea_32.png");
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h2>
|
<h2>
|
||||||
<img id="header-icon" src="" style="vertical-align: middle; display: inline"> SGBD Button on Steam
|
<img id="sgdb-icon" src="" style="vertical-align: middle; display: inline"> SGBD Button on Steam
|
||||||
</h2>
|
</h2>
|
||||||
<a class="btn" href="https://www.steamgriddb.com/profile/76561198274324627">
|
<a class="btn" href="https://www.steamgriddb.com/profile/76561198274324627">
|
||||||
<span data-tooltip-text="View my profile">
|
<span data-tooltip-text="View my profile">
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
const headerIcon = document.querySelector("#sgdb-icon");
|
||||||
|
const nesIcon = document.querySelector("#nes-icon");
|
||||||
|
const giteaIcon = document.querySelector("#gitea-icon");
|
||||||
|
headerIcon.src = browser.runtime.getURL("icons/icon_32.png");
|
||||||
|
nesIcon.src = browser.runtime.getURL("icons/nes_32.png");
|
||||||
|
giteaIcon.src = browser.runtime.getURL("icons/gitea_32.png");
|
||||||
|
});
|
Loading…
Reference in New Issue