From e210cc2764706336671a91d204f42651bb8976ce Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Sun, 25 Feb 2024 08:41:55 +0100 Subject: [PATCH 1/2] Reformat with prettier --- .prettierrc | 1 + bin/index.html | 171 ++++++++++++++++++++----------------------------- 2 files changed, 72 insertions(+), 100 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..30db571 --- /dev/null +++ b/.prettierrc @@ -0,0 +1 @@ +{ "printWidth": 120, "useTabs": true, "singleQuote": true } diff --git a/bin/index.html b/bin/index.html index 87f8489..fab2a97 100644 --- a/bin/index.html +++ b/bin/index.html @@ -1,20 +1,19 @@ - - + WebLaunch - - - + + + - + - + - - - + From 1a4e5ba1a164fd68dcf71429ba7735b7616414ac Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Sun, 25 Feb 2024 08:42:15 +0100 Subject: [PATCH 2/2] Add auto refresh --- bin/index.html | 7 +++++++ settings.example.js | 17 +++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/bin/index.html b/bin/index.html index fab2a97..36e428a 100644 --- a/bin/index.html +++ b/bin/index.html @@ -129,6 +129,13 @@ // Load url const window = kindle.chrome.createContentWindow(sessionSettings.url); + // auto refresh + if (sessionSettings.autoRefresh) { + setInterval(function () { + window.document.location = window.document.location; + }, sessionSettings.autoRefresh * 1000); + } + // Set window title kindle.chrome.setTitleBar('', sessionSettings.title); diff --git a/settings.example.js b/settings.example.js index 6c6dfab..4cb80ea 100644 --- a/settings.example.js +++ b/settings.example.js @@ -1,9 +1,10 @@ -var settings = { - url: 'http://mobileread.com', - title: 'MobileRead', - hideStatusbar: true, - enableWireless: true, - powerButtonClose: true, - enablePreventScreenSaver: false, - landscape: false +var settings = { + url: "http://mobileread.com", + title: "MobileRead", + hideStatusbar: true, + enableWireless: true, + powerButtonClose: true, + enablePreventScreenSaver: false, + landscape: false, + autoRefresh: 15, };