Notification API on Chrome, need a little info











up vote
0
down vote

favorite












I have been testing using the code from this demo:



https://davidwalsh.name/demo/notifications-api.php



The above Demo works on Chrome, Firefox, and Edge perfectly.



I used his demo to make an .aspx page. Basically view source copy/paste. I only added a <Form..> </Form> so it would work in an .aspx page. When I upload to godaddy, it works in Firefox and Edge perfectly, but fails in Chrome.



Anybody suggest any reason it would not work in Chrome from godaddy? Javascript is not my thing, but I can't find anything wrong?



Would my site not having SSL keep notifications from working? Tried to google this, but it goes off on tangents that have nothing to do with this question.



Thanks,



Slight update. My .aspx page works in localhost on Chrome (IIS Express), as well (and Firefox/Edge). It only stops working when I upload to godaddy. It never even asks to allow notifications on Chrome from godaddy. Does not work if I specifically go into settings and add the URL to allow notifications



-=-=-



One last edit. This is hard to google because there seem to be a lot of similar keywords between push notifications and web notifications. I am doing web notifications and I did find this:



Also, web notification works with both non-SSL and SSL website



That blows my one big theory...unless that's outdated.



Pretty much the core code...that works everywhere except the one place I really need it to work:



Show a Notification



<script type="text/javascript">
function showNotification() {
if(window.Notification) {
Notification.requestPermission(function(status) {
console.log('Status: ', status);
var n = new Notification('Title', { body: 'I am the body text!' });
});
}
else {
alert('Your browser doesn't support notifications.');
}
}
</script>









share|improve this question
























  • Have you checked out caniuse.com?
    – Rastalamm
    Nov 7 at 17:08








  • 2




    Please put everything relevant to the question in the body of the question with an edit, not comments. Comments can be removed. Also, no one is going to visit that link, which will be dead in an internet moment. Put everything relevant to your question in as an Minimal, Complete, and Verifiable example.
    – jdv
    Nov 7 at 17:11










  • Rastalamm that's kind of neat, but it just tells me Notifications will work in Firefox, Edge, and Chrome. Already knew that. Unless they don't work in Chrome from a godaddy web server for unknown reasons. Even works locally on chrome running in IIS, so I'm thinking it is some type of vague security issue. As noted, my site does not have SSL yet.
    – user1544428
    Nov 7 at 18:10










  • Have you checked to see if you already selected "Block all notifications" from the domain?
    – Forty3
    Nov 7 at 18:32










  • Forty3 - Yes. I specifically went in and added it to the allowed domain. Thanks.
    – user1544428
    Nov 7 at 19:02















up vote
0
down vote

favorite












I have been testing using the code from this demo:



https://davidwalsh.name/demo/notifications-api.php



The above Demo works on Chrome, Firefox, and Edge perfectly.



I used his demo to make an .aspx page. Basically view source copy/paste. I only added a <Form..> </Form> so it would work in an .aspx page. When I upload to godaddy, it works in Firefox and Edge perfectly, but fails in Chrome.



Anybody suggest any reason it would not work in Chrome from godaddy? Javascript is not my thing, but I can't find anything wrong?



Would my site not having SSL keep notifications from working? Tried to google this, but it goes off on tangents that have nothing to do with this question.



Thanks,



Slight update. My .aspx page works in localhost on Chrome (IIS Express), as well (and Firefox/Edge). It only stops working when I upload to godaddy. It never even asks to allow notifications on Chrome from godaddy. Does not work if I specifically go into settings and add the URL to allow notifications



-=-=-



One last edit. This is hard to google because there seem to be a lot of similar keywords between push notifications and web notifications. I am doing web notifications and I did find this:



Also, web notification works with both non-SSL and SSL website



That blows my one big theory...unless that's outdated.



Pretty much the core code...that works everywhere except the one place I really need it to work:



Show a Notification



<script type="text/javascript">
function showNotification() {
if(window.Notification) {
Notification.requestPermission(function(status) {
console.log('Status: ', status);
var n = new Notification('Title', { body: 'I am the body text!' });
});
}
else {
alert('Your browser doesn't support notifications.');
}
}
</script>









share|improve this question
























  • Have you checked out caniuse.com?
    – Rastalamm
    Nov 7 at 17:08








  • 2




    Please put everything relevant to the question in the body of the question with an edit, not comments. Comments can be removed. Also, no one is going to visit that link, which will be dead in an internet moment. Put everything relevant to your question in as an Minimal, Complete, and Verifiable example.
    – jdv
    Nov 7 at 17:11










  • Rastalamm that's kind of neat, but it just tells me Notifications will work in Firefox, Edge, and Chrome. Already knew that. Unless they don't work in Chrome from a godaddy web server for unknown reasons. Even works locally on chrome running in IIS, so I'm thinking it is some type of vague security issue. As noted, my site does not have SSL yet.
    – user1544428
    Nov 7 at 18:10










  • Have you checked to see if you already selected "Block all notifications" from the domain?
    – Forty3
    Nov 7 at 18:32










  • Forty3 - Yes. I specifically went in and added it to the allowed domain. Thanks.
    – user1544428
    Nov 7 at 19:02













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have been testing using the code from this demo:



https://davidwalsh.name/demo/notifications-api.php



The above Demo works on Chrome, Firefox, and Edge perfectly.



I used his demo to make an .aspx page. Basically view source copy/paste. I only added a <Form..> </Form> so it would work in an .aspx page. When I upload to godaddy, it works in Firefox and Edge perfectly, but fails in Chrome.



Anybody suggest any reason it would not work in Chrome from godaddy? Javascript is not my thing, but I can't find anything wrong?



Would my site not having SSL keep notifications from working? Tried to google this, but it goes off on tangents that have nothing to do with this question.



Thanks,



Slight update. My .aspx page works in localhost on Chrome (IIS Express), as well (and Firefox/Edge). It only stops working when I upload to godaddy. It never even asks to allow notifications on Chrome from godaddy. Does not work if I specifically go into settings and add the URL to allow notifications



-=-=-



One last edit. This is hard to google because there seem to be a lot of similar keywords between push notifications and web notifications. I am doing web notifications and I did find this:



Also, web notification works with both non-SSL and SSL website



That blows my one big theory...unless that's outdated.



Pretty much the core code...that works everywhere except the one place I really need it to work:



Show a Notification



<script type="text/javascript">
function showNotification() {
if(window.Notification) {
Notification.requestPermission(function(status) {
console.log('Status: ', status);
var n = new Notification('Title', { body: 'I am the body text!' });
});
}
else {
alert('Your browser doesn't support notifications.');
}
}
</script>









share|improve this question















I have been testing using the code from this demo:



https://davidwalsh.name/demo/notifications-api.php



The above Demo works on Chrome, Firefox, and Edge perfectly.



I used his demo to make an .aspx page. Basically view source copy/paste. I only added a <Form..> </Form> so it would work in an .aspx page. When I upload to godaddy, it works in Firefox and Edge perfectly, but fails in Chrome.



Anybody suggest any reason it would not work in Chrome from godaddy? Javascript is not my thing, but I can't find anything wrong?



Would my site not having SSL keep notifications from working? Tried to google this, but it goes off on tangents that have nothing to do with this question.



Thanks,



Slight update. My .aspx page works in localhost on Chrome (IIS Express), as well (and Firefox/Edge). It only stops working when I upload to godaddy. It never even asks to allow notifications on Chrome from godaddy. Does not work if I specifically go into settings and add the URL to allow notifications



-=-=-



One last edit. This is hard to google because there seem to be a lot of similar keywords between push notifications and web notifications. I am doing web notifications and I did find this:



Also, web notification works with both non-SSL and SSL website



That blows my one big theory...unless that's outdated.



Pretty much the core code...that works everywhere except the one place I really need it to work:



Show a Notification



<script type="text/javascript">
function showNotification() {
if(window.Notification) {
Notification.requestPermission(function(status) {
console.log('Status: ', status);
var n = new Notification('Title', { body: 'I am the body text!' });
});
}
else {
alert('Your browser doesn't support notifications.');
}
}
</script>






javascript






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 7 at 18:29

























asked Nov 7 at 16:52









user1544428

1614




1614












  • Have you checked out caniuse.com?
    – Rastalamm
    Nov 7 at 17:08








  • 2




    Please put everything relevant to the question in the body of the question with an edit, not comments. Comments can be removed. Also, no one is going to visit that link, which will be dead in an internet moment. Put everything relevant to your question in as an Minimal, Complete, and Verifiable example.
    – jdv
    Nov 7 at 17:11










  • Rastalamm that's kind of neat, but it just tells me Notifications will work in Firefox, Edge, and Chrome. Already knew that. Unless they don't work in Chrome from a godaddy web server for unknown reasons. Even works locally on chrome running in IIS, so I'm thinking it is some type of vague security issue. As noted, my site does not have SSL yet.
    – user1544428
    Nov 7 at 18:10










  • Have you checked to see if you already selected "Block all notifications" from the domain?
    – Forty3
    Nov 7 at 18:32










  • Forty3 - Yes. I specifically went in and added it to the allowed domain. Thanks.
    – user1544428
    Nov 7 at 19:02


















  • Have you checked out caniuse.com?
    – Rastalamm
    Nov 7 at 17:08








  • 2




    Please put everything relevant to the question in the body of the question with an edit, not comments. Comments can be removed. Also, no one is going to visit that link, which will be dead in an internet moment. Put everything relevant to your question in as an Minimal, Complete, and Verifiable example.
    – jdv
    Nov 7 at 17:11










  • Rastalamm that's kind of neat, but it just tells me Notifications will work in Firefox, Edge, and Chrome. Already knew that. Unless they don't work in Chrome from a godaddy web server for unknown reasons. Even works locally on chrome running in IIS, so I'm thinking it is some type of vague security issue. As noted, my site does not have SSL yet.
    – user1544428
    Nov 7 at 18:10










  • Have you checked to see if you already selected "Block all notifications" from the domain?
    – Forty3
    Nov 7 at 18:32










  • Forty3 - Yes. I specifically went in and added it to the allowed domain. Thanks.
    – user1544428
    Nov 7 at 19:02
















Have you checked out caniuse.com?
– Rastalamm
Nov 7 at 17:08






Have you checked out caniuse.com?
– Rastalamm
Nov 7 at 17:08






2




2




Please put everything relevant to the question in the body of the question with an edit, not comments. Comments can be removed. Also, no one is going to visit that link, which will be dead in an internet moment. Put everything relevant to your question in as an Minimal, Complete, and Verifiable example.
– jdv
Nov 7 at 17:11




Please put everything relevant to the question in the body of the question with an edit, not comments. Comments can be removed. Also, no one is going to visit that link, which will be dead in an internet moment. Put everything relevant to your question in as an Minimal, Complete, and Verifiable example.
– jdv
Nov 7 at 17:11












Rastalamm that's kind of neat, but it just tells me Notifications will work in Firefox, Edge, and Chrome. Already knew that. Unless they don't work in Chrome from a godaddy web server for unknown reasons. Even works locally on chrome running in IIS, so I'm thinking it is some type of vague security issue. As noted, my site does not have SSL yet.
– user1544428
Nov 7 at 18:10




Rastalamm that's kind of neat, but it just tells me Notifications will work in Firefox, Edge, and Chrome. Already knew that. Unless they don't work in Chrome from a godaddy web server for unknown reasons. Even works locally on chrome running in IIS, so I'm thinking it is some type of vague security issue. As noted, my site does not have SSL yet.
– user1544428
Nov 7 at 18:10












Have you checked to see if you already selected "Block all notifications" from the domain?
– Forty3
Nov 7 at 18:32




Have you checked to see if you already selected "Block all notifications" from the domain?
– Forty3
Nov 7 at 18:32












Forty3 - Yes. I specifically went in and added it to the allowed domain. Thanks.
– user1544428
Nov 7 at 19:02




Forty3 - Yes. I specifically went in and added it to the allowed domain. Thanks.
– user1544428
Nov 7 at 19:02












1 Answer
1






active

oldest

votes

















up vote
0
down vote













OK, after extensive testing, it has to be an SSL issue. Despite the fact that multiple websites say "Web Notifications" -- note: not Push Notifications -- do not require SSL, I found this in another stackoverflow question:




Notification api will only work if you try running it from localhost, 127.0.0.1 or https in your domain because of security concerns. It saves a service worker file on your browser so that hackers or any man in the middle can easily hack that data if it is not encrypted via SSL. So in live websites you must have SSL certificate but on your local machine you can run this using any server.




The demo script will indeed work from localhost (IIS Express), but not from IIS on 192.168.x.x



That is very frustrating because it will work in Firefox and Edge without SSL.



Also, it is super difficult to google this because it looks like not many people use Web Notications. Most search results come back for Push Notifications, which is not what I'm using.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194152%2fnotification-api-on-chrome-need-a-little-info%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    OK, after extensive testing, it has to be an SSL issue. Despite the fact that multiple websites say "Web Notifications" -- note: not Push Notifications -- do not require SSL, I found this in another stackoverflow question:




    Notification api will only work if you try running it from localhost, 127.0.0.1 or https in your domain because of security concerns. It saves a service worker file on your browser so that hackers or any man in the middle can easily hack that data if it is not encrypted via SSL. So in live websites you must have SSL certificate but on your local machine you can run this using any server.




    The demo script will indeed work from localhost (IIS Express), but not from IIS on 192.168.x.x



    That is very frustrating because it will work in Firefox and Edge without SSL.



    Also, it is super difficult to google this because it looks like not many people use Web Notications. Most search results come back for Push Notifications, which is not what I'm using.






    share|improve this answer

























      up vote
      0
      down vote













      OK, after extensive testing, it has to be an SSL issue. Despite the fact that multiple websites say "Web Notifications" -- note: not Push Notifications -- do not require SSL, I found this in another stackoverflow question:




      Notification api will only work if you try running it from localhost, 127.0.0.1 or https in your domain because of security concerns. It saves a service worker file on your browser so that hackers or any man in the middle can easily hack that data if it is not encrypted via SSL. So in live websites you must have SSL certificate but on your local machine you can run this using any server.




      The demo script will indeed work from localhost (IIS Express), but not from IIS on 192.168.x.x



      That is very frustrating because it will work in Firefox and Edge without SSL.



      Also, it is super difficult to google this because it looks like not many people use Web Notications. Most search results come back for Push Notifications, which is not what I'm using.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        OK, after extensive testing, it has to be an SSL issue. Despite the fact that multiple websites say "Web Notifications" -- note: not Push Notifications -- do not require SSL, I found this in another stackoverflow question:




        Notification api will only work if you try running it from localhost, 127.0.0.1 or https in your domain because of security concerns. It saves a service worker file on your browser so that hackers or any man in the middle can easily hack that data if it is not encrypted via SSL. So in live websites you must have SSL certificate but on your local machine you can run this using any server.




        The demo script will indeed work from localhost (IIS Express), but not from IIS on 192.168.x.x



        That is very frustrating because it will work in Firefox and Edge without SSL.



        Also, it is super difficult to google this because it looks like not many people use Web Notications. Most search results come back for Push Notifications, which is not what I'm using.






        share|improve this answer












        OK, after extensive testing, it has to be an SSL issue. Despite the fact that multiple websites say "Web Notifications" -- note: not Push Notifications -- do not require SSL, I found this in another stackoverflow question:




        Notification api will only work if you try running it from localhost, 127.0.0.1 or https in your domain because of security concerns. It saves a service worker file on your browser so that hackers or any man in the middle can easily hack that data if it is not encrypted via SSL. So in live websites you must have SSL certificate but on your local machine you can run this using any server.




        The demo script will indeed work from localhost (IIS Express), but not from IIS on 192.168.x.x



        That is very frustrating because it will work in Firefox and Edge without SSL.



        Also, it is super difficult to google this because it looks like not many people use Web Notications. Most search results come back for Push Notifications, which is not what I'm using.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 7 at 19:10









        user1544428

        1614




        1614






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194152%2fnotification-api-on-chrome-need-a-little-info%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Xamarin.form Move up view when keyboard appear

            Post-Redirect-Get with Spring WebFlux and Thymeleaf

            Anylogic : not able to use stopDelay()