This commit is contained in:
ManeraKai 2023-12-09 01:57:25 +03:00
parent 5a105da61e
commit 0babf9719d
2 changed files with 18 additions and 1 deletions

View File

@ -109,6 +109,18 @@ redirectOnlyInIncognitoElement.addEventListener('change', event => {
setOption('redirectOnlyInIncognito', 'checkbox', event)
})
const bookmarksMenuElement = document.getElementById('bookmarksMenu')
bookmarksMenuElement.addEventListener('change', async event => {
if (event.target.checked)
bookmarksMenuElement.checked = await browser.permissions.request({
permissions: ["bookmarks"]
})
else
bookmarksMenuElement.checked = !await browser.permissions.remove({
permissions: ["bookmarks"]
})
})
let themeElement = document.getElementById("theme")
themeElement.addEventListener("change", event => {
setOption("theme", "select", event)
@ -136,7 +148,8 @@ for (const service in config.services) {
let options = await utils.getOptions()
themeElement.value = options.theme
fetchInstancesElement.value = options.fetchInstances
redirectOnlyInIncognitoElement.target.checked = options.redirectOnlyInIncognito
redirectOnlyInIncognitoElement.checked = options.redirectOnlyInIncognito
bookmarksMenuElement.checked = await browser.permissions.contains({ permissions: ["bookmarks"] })
for (const service in config.services) document.getElementById(service).checked = options.popupServices.includes(service)
instanceTypeElement.addEventListener("change", event => {

View File

@ -21,6 +21,10 @@ section(class="block-option" id="general_page")
label(for='redirectOnlyInIncognito' data-localise="__MSG_redirectOnlyInIncognito__") Redirect Only in Incognito
input(id='redirectOnlyInIncognito' type="checkbox")
div(class="block block-option")
label(for='bookmarksMenu' data-localise="__MSG_bookmarksMenu__") Bookmarks menu
input(id='bookmarksMenu' type="checkbox")
div(class="block block-option")
label(data-localise="__MSG_excludeFromRedirecting__") Excluded from redirecting