Fixed popup not working https://github.com/libredirect/browser_extension/issues/901
This commit is contained in:
parent
759e403883
commit
5ca6836bd0
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "__MSG_extensionName__",
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"version": "2.8.2",
|
||||
"version": "2.8.3",
|
||||
"manifest_version": 2,
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
|
|
|
@ -112,13 +112,9 @@ redirectOnlyInIncognitoElement.addEventListener('change', event => {
|
|||
const bookmarksMenuElement = document.getElementById('bookmarksMenu')
|
||||
bookmarksMenuElement.addEventListener('change', async event => {
|
||||
if (event.target.checked)
|
||||
bookmarksMenuElement.checked = await browser.permissions.request({
|
||||
permissions: ["bookmarks"]
|
||||
})
|
||||
browser.permissions.request({ permissions: ["bookmarks"] }, r => bookmarksMenuElement.checked = r)
|
||||
else
|
||||
bookmarksMenuElement.checked = !await browser.permissions.remove({
|
||||
permissions: ["bookmarks"]
|
||||
})
|
||||
browser.permissions.remove({ permissions: ["bookmarks"] }, r => bookmarksMenuElement.checked = !r)
|
||||
})
|
||||
|
||||
let themeElement = document.getElementById("theme")
|
||||
|
@ -149,7 +145,7 @@ let options = await utils.getOptions()
|
|||
themeElement.value = options.theme
|
||||
fetchInstancesElement.value = options.fetchInstances
|
||||
redirectOnlyInIncognitoElement.checked = options.redirectOnlyInIncognito
|
||||
bookmarksMenuElement.checked = await browser.permissions.contains({ permissions: ["bookmarks"] })
|
||||
browser.permissions.contains({ permissions: ["bookmarks"] }, r => bookmarksMenuElement.checked = r)
|
||||
for (const service in config.services) document.getElementById(service).checked = options.popupServices.includes(service)
|
||||
|
||||
instanceTypeElement.addEventListener("change", event => {
|
||||
|
|
|
@ -7,15 +7,17 @@ import utils from "../../assets/javascripts/utils.js"
|
|||
document.getElementById("more-options").href = browser.runtime.getURL("pages/options/index.html")
|
||||
document.getElementById("more-options").setAttribute('target', '_blank')
|
||||
|
||||
const os = (await browser.runtime.getPlatformInfo()).os
|
||||
|
||||
switch (os) {
|
||||
await browser.runtime.getPlatformInfo(r => {
|
||||
switch (r.os) {
|
||||
case "fuchsia":
|
||||
case "ios":
|
||||
case "android": {
|
||||
document.getElementsByTagName("html")[0].classList.add("mobile")
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
const allSites = document.getElementById("all_sites")
|
||||
const currSite = document.getElementById("current_site")
|
||||
|
|
Loading…
Reference in New Issue