This repository has been archived on 2026-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
polyplus/js/settings.js
Index c1bee43f08 prepare for next update
i don't feel like writing github commit description right now
2024-05-22 17:18:55 -05:00

18 lines
No EOL
730 B
JavaScript
Executable file

const SettingsURL = chrome.runtime.getURL('settings.html')
const InExtensionSettings = (window.location.pathname.split('/')[3] === "polyplus" && window.location.hash !== "#dev")
if (InExtensionSettings === true) {
window.location.href = SettingsURL + window.location.hash
}
document.addEventListener('DOMContentLoaded', function(){
const Nav = document.getElementsByClassName('nav nav-pills')[0]
const PolyPlusItem = document.createElement('a')
PolyPlusItem.classList = 'nav-link'
PolyPlusItem.href = SettingsURL
PolyPlusItem.innerHTML = `
<i class="fa-regular fa-sparkles me-1"></i> <span class="pilltitle">Poly+</span>
`
Nav.insertBefore(PolyPlusItem, Nav.getElementsByTagName('hr')[0])
});