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 3d6b265de0 Importing Utility Module!!!!!!!!!
- Repetitive code is now way easier to edit as it is now stored in the utility module rather than the same code in several different files

- Changed "Theme Creator" Copy JSON button to have the text "Copy" rather than rely on an icon due to me forgetting to import fontawesome

- Hopefully fixed the store page randomly not working by not showing IRL prices or not showing the owned tags (may rewrite the entire code for that file since it is pretty old like Early Summer 2023)

- Fixed clicking on "Poly+" in the sidebar on the settings page sending you to an invalid page (due to browser security stuff) which wasn't happening to me before public beta

- Disabled importing theme data JSON for now to ensure security
2024-02-10 10:25:28 -06:00

23 lines
No EOL
864 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])
});