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
dargy 456bf389f0 fix: theme settings being applied before settings
fixes `TypeError: Settings is undefined` on firefox
2024-06-17 21:58:02 -05:00

19 lines
752 B
JavaScript
Executable file

const SettingsURL = chrome.runtime.getURL('settings.html');
const InExtensionSettings = window.location.pathname.split('/')[3] === 'polyplus' && window.location.hash !== '#dev' && window.location.hash !== '#debug';
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]);
});