Skip to content

Instantly share code, notes, and snippets.

View docluv's full-sized avatar
🏠
Working from home

Chris Love docluv

🏠
Working from home
View GitHub Profile
@docluv
docluv / SPA.js
Created September 24, 2016 21:36 — forked from simonhearne/SPA.js
Custom metric for WebPageTest to detect single page application frameworks
var SPA="none";
if (typeof(app)=="object") SPA = "unknown";
if (window.hasOwnProperty('require')) {
if(window.require.hasOwnProperty('defined')){
if(window.require.defined('troopjs-compose/decorator')) SPA = "troop";
if(window.require.defined('flight/lib/component')) SPA = "flight";
}
}
/*
Migrated to: https://github.com/jdarling/Object.observe
Tested against Chromium build with Object.observe and acts EXACTLY the same,
though Chromium build is MUCH faster
Trying to stay as close to the spec as possible,
this is a work in progress, feel free to comment/update
http://wiki.ecmascript.org/doku.php?id=harmony:observe