Skip to content

Commit

Permalink
Replace cat GIF source (mdn#440)
Browse files Browse the repository at this point in the history
chilloutandwatchsomecatgifs.com now appears to serve ads. Replaced the link open on activating the page action with https://giphy.com/explore/cat. Also made some minor improvements to the readme file.
  • Loading branch information
rebloor authored Feb 12, 2020
1 parent 2f20eed commit c86653a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions chill-out/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

## What it does

After N seconds of inactivity (defined as the user not having navigated
After 6 seconds of inactivity (defined as the user not having navigated
or switched away from the active tab) display a
[page action](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/pageAction)
for that tab.

When the user clicks the page action,
navigate to http://chilloutandwatchsomecatgifs.com/.
When the user clicks the page action, navigate to https://giphy.com/explore/cat.

"N" is set to 6 seconds in this example. Such a short period is chosen to make
the extension's behavior more obvious, but this is not recommended in real life.
Note that in Chrome, alarms cannot be set for less than a minute. In Chrome:
The delay of 6 seconds is to make the extension's behavior obvious, but such a short
period is not recommended in practical applications. Note that in Chrome, alarms do not
fire in under a minute. In Chrome:

* if you install this extension "unpacked", you'll see a warning
in the console, but the alarm will still go off after 6 seconds
Expand All @@ -21,6 +20,8 @@ a minute.

## What it shows

* how to use various `tabs` functions
* how to show/hide a page action
* how to set alarms and handle alarms going off
How to:

* use various `tabs` functions.
* show and hide a page action.
* set alarms and handle alarms going off.
2 changes: 1 addition & 1 deletion chill-out/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ in the console, but the alarm will still go off after 6 seconds
a minute.
*/
var DELAY = 0.1;
var CATGIFS = "http://chilloutandwatchsomecatgifs.com/";
var CATGIFS = "https://giphy.com/explore/cat";

/*
Restart alarm for the currently active tab, whenever background.js is run.
Expand Down

0 comments on commit c86653a

Please sign in to comment.