Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bookmarklet #13

Open
Nolanus opened this issue Nov 9, 2016 · 2 comments
Open

Bookmarklet #13

Nolanus opened this issue Nov 9, 2016 · 2 comments

Comments

@Nolanus
Copy link

Nolanus commented Nov 9, 2016

Using the following javascript one may include and init the notification logger at any page without having to put dev-only dependencies or script tags into the code:

if (typeof window.logger === 'undefined') {
    var script = document.createElement('script');
    script.src = 'http://singhharkirat.com/notification-logger/notification-logger.js'; 
    document.body.appendChild(script);
}
window.logger.init();

Putting that as a bookmarklet link and you've got a quick way to activate notification-logger on any page:

<a href="javascript:if(typeof window.logger=='undefined'){var script=document.createElement('script');script.src='http://singhharkirat.com/notification-logger/notification-logger.js';document.body.appendChild(script);}window.logger.init();">Bookmarklet</a>

Maybe you want to add that to the description page.

@Nolanus Nolanus changed the title Make Bookmarklet Bookmarklet Nov 9, 2016
@zeckdude
Copy link

Wouldn't that bookmarklet need to be clicked every time the page is refreshed?

@Nolanus
Copy link
Author

Nolanus commented Dec 30, 2016

Yes, that's correct. The document change is only temporarily.

An alternative to overcome this could be a browser extension that performs the "insertion" on every page load. But that might be a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants