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
2024-05-28 00:23:56 +00:00

18 lines
716 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]);
});