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/polyplus-settings.js
Index 976cdfbf25 February 8th is going to be a good day
- New Icon

- Moved avatar-sandbox.html and utils.js to /resources

- Browser automatically allows resources to be used from the resources folder

- Code Improvements

- Deleted trick-or-treat.js

- Bug Fixes
2024-02-07 17:06:33 -06:00

25 lines
No EOL
868 B
JavaScript
Executable file

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