Skip to content

Instantly share code, notes, and snippets.

View querymetrics's full-sized avatar

Nigel Heron querymetrics

View GitHub Profile
@querymetrics
querymetrics / loader-onload.js
Last active November 14, 2017 22:54
mPulse Loader snippet that delays Boomerang loading until onLoad has occurred
<script>
(function(){
if (window.BOOMR && window.BOOMR.version) { return; }
var win = window;
function boomerangSaveLoadTime(e) {
win.BOOMR_onload=(e && e.timeStamp) || new Date().getTime();
}
function boomerangLoad() {
@querymetrics
querymetrics / patch.diff
Created April 10, 2018 14:34
WIP auto-xhr patch
diff --git a/plugins/auto-xhr.js b/plugins/auto-xhr.js
index 78a9defa..d495cb21 100644
--- a/plugins/auto-xhr.js
+++ b/plugins/auto-xhr.js
@@ -1028,16 +1028,23 @@
if (node.nodeName.toUpperCase().match(/^(IMG|SCRIPT|IFRAME|IMAGE)$/) ||
(node.nodeName === "LINK" && node.rel && node.rel.match(/\<stylesheet\>/i))) {
- // if the attribute change affected the src/currentSrc attributes we want to know that
- // as that means we need to fetch a new Resource from the server