• Resolved alidixon

    (@alidixon)


    I’m sure you get asked this all the time but how can I defer loading of onesignal? I cant find a solution anywhere. At the moment the plugin is getting loaded in the head which is not very efficient for my page load.

    Best,
    Alastair

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author OneSignal Push Notifications

    (@onesignal)

    OneSignal actually uses the HTML async attribute to prevent the script from slowing down the loading of the page, this is a little better than loading the javascript at a different part of the page markup. You can read more about this here: https://alligator.io/html/defer-async/

    We don’t put the script in the body or use the defer attribute because there are cases where this could greatly slow down OneSignal from initializing and would not lead to a benefit in page load speed.

    The async attribute is supported in all browsers, as far back as Chrome 1.

Viewing 1 replies (of 1 total)
  • The topic ‘Defer loading of Onesignal’ is closed to new replies.