// @ts-check /**

*  WebMentions.io JS
*  A re-tooling of Aaron Parecki’s recommended JS for using the WebMention.io API
* 
*  Updates Webmentions on a static site immediately when the page is loaded and
*  in real-time (using WebSockets) as the user engages with the page.
* 
* To inform the JavaScript of additional URLs to check (e.g. when the current page 
* receives redirects from old URLs), use the following meta element:
* 
*  <meta property="webmention:redirected_from" content="URL_1,URL_2">
* 
* The content should be a single URL or multiple, separated by commas.
*/

;(function( window, document ){

'use strict';

if ( ! window.location.origin )
{
  window.location.origin = window.location.protocol + '//' + window.location.host;
}

// http://tokenposts.blogspot.com.au/2012/04/javascript-objectkeys-browser.html
if (!Object.keys) Object.keys = function(o) {
  if (o !== Object(o))
  throw new TypeError('Object.keys called on a non-object');
  var k=[],p;
  for (p in o) if (Object.prototype.hasOwnProperty.call(o,p)) k.push(p);
  return k;
};

}(this,this.document));