mirror of
https://github.com/aureliendavid/rsspreview.git
synced 2025-08-22 11:18:37 +00:00
fix default options for android
This commit is contained in:
parent
257dcbdfab
commit
5307b43846
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "RSSPreview",
|
"name": "RSSPreview",
|
||||||
"version": "3.30",
|
"version": "3.31",
|
||||||
"author": "Aurelien David",
|
"author": "Aurelien David",
|
||||||
"homepage_url": "https://github.com/aureliendavid/rsspreview",
|
"homepage_url": "https://github.com/aureliendavid/rsspreview",
|
||||||
|
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
|
|
||||||
var options = {
|
|
||||||
newTab: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
var android = false;
|
var android = false;
|
||||||
|
|
||||||
browser.runtime.getPlatformInfo().then((info) => {
|
browser.runtime.getPlatformInfo().then((info) => {
|
||||||
@ -10,16 +6,6 @@ browser.runtime.getPlatformInfo().then((info) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
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) {
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
|
|
||||||
|
|
||||||
@ -30,6 +16,9 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
|||||||
const tabId = +url.searchParams.get('tabId');
|
const tabId = +url.searchParams.get('tabId');
|
||||||
const feeds = JSON.parse(url.searchParams.get('feeds'));
|
const feeds = JSON.parse(url.searchParams.get('feeds'));
|
||||||
|
|
||||||
|
browser.runtime.getPlatformInfo().then((info) => {
|
||||||
|
android = info.os == "android";
|
||||||
|
|
||||||
for (feed_url in feeds) {
|
for (feed_url in feeds) {
|
||||||
if (feeds.hasOwnProperty(feed_url)) {
|
if (feeds.hasOwnProperty(feed_url)) {
|
||||||
|
|
||||||
@ -43,18 +32,18 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
|||||||
|
|
||||||
li.appendChild(a);
|
li.appendChild(a);
|
||||||
|
|
||||||
browser.runtime.getPlatformInfo().then((info) => {
|
|
||||||
android = info.os == "android"
|
|
||||||
|
|
||||||
if (android)
|
if (android)
|
||||||
li.classList.add("android-feed-btn");
|
li.classList.add("android-feed-btn");
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
feedList.appendChild(li);
|
feedList.appendChild(li);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
browser.storage.sync.get({newTab: !android}).then(function(options) {
|
||||||
|
|
||||||
document.querySelectorAll(".panel-list-item").forEach( (elem) => {
|
document.querySelectorAll(".panel-list-item").forEach( (elem) => {
|
||||||
|
|
||||||
function onUpdated(tab) {
|
function onUpdated(tab) {
|
||||||
@ -82,6 +71,10 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
}); // end forall
|
||||||
|
|
||||||
|
}); // end options
|
||||||
|
|
||||||
|
}); // and getplatform
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user