same-origin
Checks if two URLs pass the "same origin"-policy (RFC 6454)
Installation
Run npm install --save same-origin
to include it in your project.
Works well with browserify.
Usage
var sameOrigin = ;var url1 = 'http://example.com/some/page.html';var url2 = 'http://example.com/some/other/page.html';var url3 = 'http://espen.codes/nodejs';; // true; // false
same-origin
works in most environments:
// CommonJSvar sameOrigin = ; // AMD (Require.JS, yepnope, dojo...); // Browser global (if CommonJS/AMD environment not found)window;
License
MIT-licensed. See LICENSE.