Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnguyennz committed Aug 19, 2020
0 parents commit 807e4d1
Show file tree
Hide file tree
Showing 21 changed files with 1,946 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Page Refresher

A simple per-tab automatic page refresher/reloader for Google Chrome.

##### Features

- tab based (tab ID) reloads
- 5 customizable intervals
- refresh info table
- blocks automatic reloads or meta refreshes (per tab)
- bypass local cache (per tab)
- context menu functionality

##### Required Permissions
- storage - used to store default settings and save user preferences
- contextMenus - used to enable the optional context (right click) menu for this extension
- tabs - used to get the title from each tab (to be displayed in the options page)
- <all_urls> - used to execute the code to block reloads

Warning: Some sites may restrict your access to them if you make too many requests (or reloads) within a short period of time.
9 changes: 9 additions & 0 deletions public/background.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Background</title>
</head>
<body>
<script type="module" src="./src/js/background.js"></script>
</body>
</html>
45 changes: 45 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->


</body>
</html>
31 changes: 31 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"manifest_version": 2,
"name": "Page Refresher",
"version": "0.1",
"author": "Alex Nguyen",
"description": "A simple per-tab automatic page refresher/reloader.",
"icons": {
"16": "./src/img/logo-16.png",
"48": "./src/img/logo-48.png",
"128": "./src/img/logo-128.png"
},
"background": {
"page": "background.html",
"persistent": false
},
"permissions": [
"storage",
"contextMenus",
"tabs",
"<all_urls>"
],
"browser_action": {
"default_title": "Page Refresher",
"default_popup": "popup.html"
},
"options_ui": {
"page": "options.html",
"open_in_tab": true
},
"homepage_url": "https://github.com/alexnguyennz/pagerefresher"
}
125 changes: 125 additions & 0 deletions public/options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<!doctype html>
<html>

<head>
<title>Page Refresher - Options</title>
<link rel="stylesheet" href="./src/css/options.css">
</head>

<body>

<img src="./src/img/banner.png">
<p id="extension-info">
Version: 0.1<br>
Author: Alex Nguyen<br>
Source Code: <a href="https://github.com/alexnguyennz/pagerefresher" target="_blank">https://github.com/alexnguyennz</a>
</p>

<div class="right-align">
<input type="checkbox" id="display-all-tabs">
<label for="display-all-tabs">Display all tab info</label>
</div>

<div>
<table id="reload-table">
<thead>
<th>Title</th>
<th>URL</th>
<th>Refresh Interval</th>
<th>Block Reloads</th>
<th>Bypass Cache</th>
<th>Actions</th>
</thead>

<tbody>
</tbody>
</table>
</div>

<hr>

<h2>Options</h2>

<details>
<summary>Set custom intervals</summary>
<p>Set commonly used interval/reload times. These will appear in the extension icon menu and the context menu.</p>
</details>
<div class="grid-container">
<div class="grid-item">
<strong>Interval One</strong><br>
<label for="intervalOne-minutes">Minutes: </label>
<label for="intervalOne-seconds">Seconds: </label>
<input type="number" id="intervalOne-minutes" name="interval" min="0" value="0" required>
<input type="number" id="intervalOne-seconds" name="interval" min="0" value="0" required>
</div>

<div class="grid-item">
<strong>Interval Two</strong><br>
<label for="intervalTwo-minutes">Minutes: </label>
<label for="intervalTwo-seconds">Seconds: </label>
<input type="number" id="intervalTwo-minutes" name="interval" min="0" value="0" required>
<input type="number" id="intervalTwo-seconds" name="interval" min="0" value="0" required>
</div>
<div class="grid-item">
<strong>Interval Three</strong><br>
<label for="intervalThree-minutes">Minutes: </label>
<label for="intervalThree-seconds">Seconds: </label>
<input type="number" id="intervalThree-minutes" name="interval" min="0" value="0" required>
<input type="number" id="intervalThree-seconds" name="interval" min="0" value="0" required>
</div>
<div class="grid-item">
<strong>Interval Four</strong><br>
<label for="intervalFour-minutes">Minutes: </label>
<label for="intervalFour-seconds">Seconds: </label>
<input type="number" id="intervalFour-minutes" name="interval" min="0" value="0" required>
<input type="number" id="intervalFour-seconds" name="interval" min="0" value="0" required>
</div>
<div class="grid-item">
<strong>Interval Five</strong><br>
<label for="intervalFive-minutes">Minutes: </label>
<label for="intervalFive-seconds">Seconds: </label>
<input type="number" id="intervalFive-minutes" name="interval" min="0" value="0" required>
<input type="number" id="intervalFive-seconds" name="interval" min="0" value="0" required>
</div>
</div>

<details>
<summary>Enable Page Refresher in context menu</summary>
<p>Enable or disable this extension in the context menu (right click).</p>
</details>
<p>
<input type="radio" id="context-enabled" name="context-option" value="On">
<label for="context-enabled">On</label>
<input type="radio" id="context-disabled" name="context-option" value="Off">
<label for="context-disabled">Off</label>
</p>

<p class="submit-buttons">
<button id="save-options">Save</button>
<button id="reset-options">Reset</button>
<span id="message"></span>
</p>

<hr>

<details>
<summary>Block auto reloading (per tab)</summary>
<p>Stop pages from auto refreshing. This can cause some pages to not function correctly. This option is disabled on pages that block this feature. Turning this option off will reload the tab.
<ul>
<li class="blocked-urls">chrome://</li>
<li class="blocked-urls">chrome-extension://</li>
<li class="blocked-urls">https://chrome.google.com/webstore/</li>
</ul>
</p>
</details>

<details>
<summary>Bypass local cache (per tab)</summary>
<p>Bypasses the local cache upon each reload. This ensures you're always browsing the latest version of the page. This option only works with this extension's reloading process.</p>
</details>

<script type="module" src="./src/js/options.js"></script>

</body>

</html>
51 changes: 51 additions & 0 deletions public/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!doctype html>
<html>

<head>
<title>Page Refresher - Popup</title>
<link rel="stylesheet" href="./src/css/popup.css">
</head>

<body>

<div class="interval-block">
<label for="minuteInterval" class="interval-label">Minutes: </label>
<input type="number" id="minuteInterval" name="customInterval" class="interval-inputs" min="0" value="0">

<label for="secondInterval" class="interval-label">Seconds: </label>
<input type="number" id="secondInterval" name="customInterval" class="interval-inputs" min="0" value="0">
</div>

<div id="reload-toggle">
<input type="checkbox" id="option">
<div class="knobs"><span>OFF</span></div>
<div class="layer"></div>
</div>

<div class="custom-intervals">
<input type="radio" id="intervalOne" name="definedInterval" class="definedInterval"><label for="intervalOne"></label>
<input type="radio" id="intervalTwo" name="definedInterval" class="definedInterval"><label for="intervalTwo"></label>
<input type="radio" id="intervalThree" name="definedInterval" class="definedInterval"><label for="intervalThree"></label>
<input type="radio" id="intervalFour" name="definedInterval" class="definedInterval"><label for="intervalFour"></label>
<input type="radio" id="intervalFive" name="definedInterval" class="definedInterval"><label for="intervalFive"></label>
</div>

<hr>

<div>
<input type="checkbox" id="blockReload">
<label for="blockReload">Block Auto Reloading</label>
</div>

<div>
<input type="checkbox" id="bypassCache">
<label for="bypassCache">Bypass Local Cache</label>

<a id="option-link" href="/options.html" target="_blank" alt="Settings page" title="Go to settings"></a>
</div>

<script type="module" src="./src/js/popup.js"></script>

</body>

</html>
3 changes: 3 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
Loading

0 comments on commit 807e4d1

Please sign in to comment.