Skip to content

Commit

Permalink
Fixed popup not working #901
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Mar 11, 2024
1 parent 759e403 commit 5ca6836
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
10 changes: 3 additions & 7 deletions src/pages/options/widgets/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 => {
Expand Down
16 changes: 9 additions & 7 deletions src/pages/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
case "fuchsia":
case "ios":
case "android": {
document.getElementsByTagName("html")[0].classList.add("mobile")
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")
Expand Down

0 comments on commit 5ca6836

Please sign in to comment.