Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Polyfill for window.location.origin
JavaScript Erlang CoffeeScript
branch: master
Failed to load latest commit information.
dist simplify
src simplify
.editorconfig add and run .editorconfig
.gitattributes add .gitattributes
.gitignore init
.jshintrc update .jshintrc
.travis.yml test on Node v0.12 and io.js
LICENSE-MIT update doc
LICENSE-UNLICENSE apply MIT license to the dev tools
README.md
bower.json update package settings
component.json update package settings
gulpfile.js tweak gulpfile
package.json update devDependencies
test.js update .jshintrc

README.md

location-origin.js

Bower version NPM version Build Status devDependency Status

browser support

Polyfill for window.location.origin

// On http://localhost:8888/path/to/page.html#hash?search=foobar

window.location.origin; //=> "http://localhost:8888"

Installation

Package managers

Bower

bower install location-origin

npm

npm install location-origin

Duo

// You don't have to assign it to a variable.
// It automatically adds `origin` property to the window.location object when it is `require`d.
require("shinnn/location-origin.js");

Standalone

Download the script file directly.

Acknowledgements

I used the blog post by Toby Osbourn as reference. Thanks, tosbourn.

License

src/location-origin.coffee and dist/location-origin.js are licensed under the Unlicense.

All other source code is licensed under the MIT license.

Something went wrong with that request. Please try again.