cubiq/add-to-homescreen — pull request #10 by nicam (2011-11-16 15:27:58+00:00)
Title: showOnPathOnly to allow execution filtering

In our project we built the whole project into one single .js file. The add2Homescreen bubble should not appear on all pages so we need a way to tell it not to show up.

Therefore I implemented the showOnPathOnly parameter. You can pass it an array of regex conditions which will be checked on window.location.pathname. If one of them match the bubble appears. If the conditions are empty the check will be ignored.

I also made the loaded method public so it can be called again when for instance the url has been changed through html5 history.