├── .gitignore
├── icon128.png
├── icon16.png
├── icon19.png
├── icon38.png
├── icon48.png
├── promotional_440x280.png
├── screenshot_440x280_1.png
├── screenshot_440x280_2.png
├── screenshot_640x400_1.png
├── screenshot_640x400_2.png
├── make_zip.sh
├── manifest.json
├── LICENSE
├── README.md
├── popup.html
├── popup.js
├── icon.svg
├── background.js
└── promotional_440x280.svg
/.gitignore:
--------------------------------------------------------------------------------
1 | crx-reload-tab.zip
2 |
--------------------------------------------------------------------------------
/icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/denilsonsa/crx-reload-tab/HEAD/icon128.png
--------------------------------------------------------------------------------
/icon16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/denilsonsa/crx-reload-tab/HEAD/icon16.png
--------------------------------------------------------------------------------
/icon19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/denilsonsa/crx-reload-tab/HEAD/icon19.png
--------------------------------------------------------------------------------
/icon38.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/denilsonsa/crx-reload-tab/HEAD/icon38.png
--------------------------------------------------------------------------------
/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/denilsonsa/crx-reload-tab/HEAD/icon48.png
--------------------------------------------------------------------------------
/promotional_440x280.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/denilsonsa/crx-reload-tab/HEAD/promotional_440x280.png
--------------------------------------------------------------------------------
/screenshot_440x280_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/denilsonsa/crx-reload-tab/HEAD/screenshot_440x280_1.png
--------------------------------------------------------------------------------
/screenshot_440x280_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/denilsonsa/crx-reload-tab/HEAD/screenshot_440x280_2.png
--------------------------------------------------------------------------------
/screenshot_640x400_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/denilsonsa/crx-reload-tab/HEAD/screenshot_640x400_1.png
--------------------------------------------------------------------------------
/screenshot_640x400_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/denilsonsa/crx-reload-tab/HEAD/screenshot_640x400_2.png
--------------------------------------------------------------------------------
/make_zip.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | rm -f crx-reload-tab.zip
4 | zip -9Xr crx-reload-tab.zip \
5 | background.js \
6 | icon128.png \
7 | icon16.png \
8 | icon19.png \
9 | icon38.png \
10 | icon48.png \
11 | manifest.json \
12 | popup.html \
13 | popup.js
14 |
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifest_version": 2,
3 |
4 | "name": "Tab auto reloader",
5 | "short_name": "Tab reloader",
6 | "description": "This extension reloads the current tab at a chosen interval.",
7 | "version": "1.1",
8 | "homepage_url": "https://github.com/denilsonsa/crx-reload-tab/",
9 |
10 | "icons": {
11 | "16": "icon16.png",
12 | "48": "icon48.png",
13 | "128": "icon128.png"
14 | },
15 | "browser_action": {
16 | "default_icon": {
17 | "19": "icon19.png",
18 | "38": "icon38.png"
19 | },
20 | "default_popup": "popup.html",
21 | "default_title": "Reload this page every…"
22 | },
23 | "background": {
24 | "scripts": [ "background.js" ],
25 | "persistent": true
26 | },
27 | "permissions": [
28 | "contextMenus",
29 | "storage"
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Denilson Figueiredo de Sá
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Tab auto reloader (Chrome extension)
2 | ====================================
3 |
4 | [Donation - buy me a coffee](https://denilson.sa.nom.br/donate.html)
5 |
6 | Chrome extension to reload the current tab at a chosen interval. [Get it on Chrome Web Store!][cws]
7 |
8 | [][cws]
9 |
10 | Features:
11 |
12 | * Free and open-source.
13 | * No (extra) permissions required.
14 | * Easy-to-use.
15 | * The reload interval can be different for each tab.
16 |
17 | The icon is a remix of public-domain cliparts [stopwatch by
18 | markroth8][stopwatch] and [Reload icon by mlampret][reload].
19 |
20 | Technical stuff
21 | ---------------
22 |
23 | ### Persistent background page
24 |
25 | This extension is implemented using a persistent background page. Ideally, it
26 | could have been an [event page][event_pages] that only gets loaded when there
27 | is a tab being reloaded, and gets unloaded if no tabs are being auto-reloaded.
28 |
29 | However, I could not find a way to keep an event page active. The documentation
30 | states that *"The event page will not shut down until all message ports are
31 | closed."*, but keeping a global [`Port` object][port] at the background page
32 | was not enough to prevent it from being suspended.
33 |
34 | There is also the [alarms API][alarms], but the minimum interval is one minute,
35 | which is unsuitable for the purposes of this extension.
36 |
37 | If someone finds a better way to implement this extension, feel free to open
38 | [an issue][issues] or send [a pull request][pulls].
39 |
40 | ### Icon badge and Chrome event listeners
41 |
42 | The small text below the icon is called [badge][]. When the [badge text is
43 | set][setBadgeText] to a single tab, the badge gets reset whenever the tab loads
44 | another page (or reloads the same page).
45 |
46 | For that reason, the extension adds a listener to
47 | [`chrome.tabs.onUpdated`][onUpdated] to restore the badge text after reloading.
48 |
49 | In addition, the extension adds a listener to
50 | [`chrome.tabs.onRemoved`][onRemoved] to clear the reload whenever a tab gets
51 | closed.
52 |
53 | The extension is smart enough to remove the listeners if no tab is being
54 | auto-reloaded.
55 |
56 |
57 | [cws]: https://chrome.google.com/webstore/detail/knnahnemielbnanghaphjgheamgcjjcb
58 | [issues]: https://github.com/denilsonsa/crx-reload-tab/issues
59 | [pulls]: https://github.com/denilsonsa/crx-reload-tab/pulls
60 | [reload]: https://openclipart.org/detail/171074/reload-icon
61 | [stopwatch]: https://openclipart.org/detail/173421/stopwatch
62 | [alarms]: https://developer.chrome.com/extensions/alarms
63 | [event_pages]: https://developer.chrome.com/extensions/event_pages
64 | [port]: https://developer.chrome.com/extensions/runtime#type-Port
65 | [badge]: https://developer.chrome.com/extensions/browserAction#badge
66 | [setBadgeText]: https://developer.chrome.com/extensions/browserAction#method-setBadgeText
67 | [onUpdated]: https://developer.chrome.com/extensions/tabs#event-onUpdated
68 | [onRemoved]: https://developer.chrome.com/extensions/tabs#event-onRemoved
69 |
--------------------------------------------------------------------------------
/popup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |