Giter Club home page Giter Club logo

crx-reload-tab's Introduction

Tab auto reloader (Chrome extension)

Donation - buy me a coffee

Chrome extension to reload the current tab at a chosen interval. Get it on Chrome Web Store!

Screenshot of this extension

Features:

  • Free and open-source.
  • No (extra) permissions required.
  • Easy-to-use.
  • The reload interval can be different for each tab.

The icon is a remix of public-domain cliparts stopwatch by markroth8 and Reload icon by mlampret.

Technical stuff

Persistent background page

This extension is implemented using a persistent background page. Ideally, it could have been an event page that only gets loaded when there is a tab being reloaded, and gets unloaded if no tabs are being auto-reloaded.

However, I could not find a way to keep an event page active. The documentation states that "The event page will not shut down until all message ports are closed.", but keeping a global Port object at the background page was not enough to prevent it from being suspended.

There is also the alarms API, but the minimum interval is one minute, which is unsuitable for the purposes of this extension.

If someone finds a better way to implement this extension, feel free to open an issue or send a pull request.

Icon badge and Chrome event listeners

The small text below the icon is called badge. When the badge text is set to a single tab, the badge gets reset whenever the tab loads another page (or reloads the same page).

For that reason, the extension adds a listener to chrome.tabs.onUpdated to restore the badge text after reloading.

In addition, the extension adds a listener to chrome.tabs.onRemoved to clear the reload whenever a tab gets closed.

The extension is smart enough to remove the listeners if no tab is being auto-reloaded.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.