Giter Club home page Giter Club logo

notification-logger's People

Contributors

danielmcgraw avatar hkirat avatar jarifibrahim avatar ketanhwr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notification-logger's Issues

Bookmarklet

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.

Support Chrome for Android

I’ve tested your demo in browsers on Android; it works in Firefox, but not in Chrome. Could you confirm?

Remove duplication of code...

You talk about it only being ~100 lines of code, but you duplicated the code for one of the main functions, which just increases the number of lines quite a bit...

You can probably remove all that by re-using the same function... talking about this one (and what is in genericLogger())...

function log(body, title) {
        title = title || "Notification";
        if (!("Notification" in window)) {
            alert("This browser does not support desktop notification");
        } else if (Notification.permission === "granted") {
            new Notification(title ,{body: body});
        } else if (Notification.permission !== 'denied') {
            Notification.requestPermission(function (permission) {
                if (permission === "granted") {
                    new Notification(title ,{body: body});
                }
        });
      }
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.