Skip to content

Commit

Permalink
fix default options for android
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliendavid committed May 3, 2024
1 parent 257dcbd commit 5307b43
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"manifest_version": 2,
"name": "RSSPreview",
"version": "3.30",
"version": "3.31",
"author": "Aurelien David",
"homepage_url": "https://github.com/aureliendavid/rsspreview",

Expand Down
37 changes: 15 additions & 22 deletions popup/popup.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@

var options = {
newTab: true,
};

var android = false;

browser.runtime.getPlatformInfo().then((info) => {
android = info.os == "android"
});


function onOptions(opts) {
options = opts;
}

function onError(error) {
console.log(`Error on get options: ${error}`);
}

browser.storage.sync.get(options).then(onOptions, onError);

document.addEventListener("DOMContentLoaded", function(event) {


Expand All @@ -30,6 +16,9 @@ document.addEventListener("DOMContentLoaded", function(event) {
const tabId = +url.searchParams.get('tabId');
const feeds = JSON.parse(url.searchParams.get('feeds'));

browser.runtime.getPlatformInfo().then((info) => {
android = info.os == "android";

for (feed_url in feeds) {
if (feeds.hasOwnProperty(feed_url)) {

Expand All @@ -43,18 +32,18 @@ document.addEventListener("DOMContentLoaded", function(event) {

li.appendChild(a);

browser.runtime.getPlatformInfo().then((info) => {
android = info.os == "android"

if (android)
li.classList.add("android-feed-btn");
});

if (android)
li.classList.add("android-feed-btn");

feedList.appendChild(li);
}
}




browser.storage.sync.get({newTab: !android}).then(function(options) {

document.querySelectorAll(".panel-list-item").forEach( (elem) => {

function onUpdated(tab) {
Expand Down Expand Up @@ -82,6 +71,10 @@ document.addEventListener("DOMContentLoaded", function(event) {

});

});
}); // end forall

}); // end options

}); // and getplatform

});

0 comments on commit 5307b43

Please sign in to comment.