Change the title and the favicon of the website when a visitor navigates to another tab. 💔
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
src
.eslintrc
.gitignore
LICENSE.txt
README.md
bower.json
gulpfile.js
package.json

README.md

Please Don't Go 💔

Please Don't Go is a JavaScript plugin used for changing the title and the favicon of the website when a visitor navigates to another tab in the window.

Installation

Please Don't Go is available on Bower and GitHub.

Bower

bower install pleaseDontGo
<script type="text/javascript" src="path/to/bower_components/pleaseDontGo/dist/pleaseDontGo.min.js"></script>

GitHub

Download the script or the minified version in the dist folder.

<script type="text/javascript" src="path/to/pleaseDontGo.min.js"></script>

Usage

The plugin, which does not depend on jQuery, will look for the link element with rel="icon".

<link rel="icon" type="image/x-icon" href="path/to/favicon.ico">
<script type="text/javascript">
  pleaseDontGo.init({
    newTitle: 'Please Don\'t Go',
    newFavicon: '/assets/images/favicon-dontgo.ico',
    timeout: 2000
  });
</script>

The plugin also allows you to set the new title, the path to the new favicon, and the timeout delay for switching them around.

Changelog

1.0

  • Initial release

Issues

Please submit any issues here.

License

Please Don't Go is licensed under the MIT License.