pcmt/assets/public/js/browsersync.js
leo 50c3c939b6
All checks were successful
continuous-integration/drone/push Build is passing
head.tmpl: add Content Security Policy meta attr
* implement calculating integrity for script, stylesheet assets
* break out browser-sync loader script to its own file (instead of
  inline)
* implement Content Security Policy that only allows BrowserSync scripts
  and hooks to load from localhost when DevelMode is enabled (i.e. not
  in production)
2023-05-15 14:12:39 +02:00

16 lines
545 B
JavaScript

(function() {
try {
var script = document.createElement('script');
if ('async') {
script.async = true;
}
// script.src = 'http://HOST:3002/browser-sync/browser-sync-client.js?v=2.29.0'.replace("HOST", location.hostname);
script.src = 'http://localhost:3002/browser-sync/browser-sync-client.js?v=2.29.0';
if (document.body) {
document.body.appendChild(script);
}
} catch (e) {
console.error("Browsersync: could not append script tag", e);
}
})()