notification-logger icon indicating copy to clipboard operation
notification-logger copied to clipboard

Bookmarklet

Open Nolanus opened this issue 8 years ago • 2 comments

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 avatar Nov 09 '16 11:11 Nolanus

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

zeckdude avatar Dec 27 '16 19:12 zeckdude

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

Nolanus avatar Dec 30 '16 05:12 Nolanus