Socket
Socket
Sign inDemoInstall

browser-history-lite

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.4 to 0.1.5

79

dist/hash-only-src.js

@@ -6,4 +6,4 @@ /*! litejs.com/MIT-LICENSE.txt */

/*
* @version 0.1.4
* @date 2015-04-23
* @version 0.1.5
* @date 2016-03-09
* @stability 2 - Unstable

@@ -54,5 +54,2 @@ * @author Lauri Rooden <lauri@rooden.ee>

//*/
// Fix decode
// http://unixpapa.com/js/querystring.html
url = decodeURIComponent(url.replace(/\+/g, " "))
return url.replace(clean_route, "")

@@ -62,3 +59,2 @@ }

function setUrl(url, replace) {
url = encodeURIComponent(url).replace(/%20/g, "+").replace(/%2F/gi, "/")
/*** PUSH

@@ -89,40 +85,39 @@ if (base) {

history.start = function(_cb, _base) {
if (!cb) {
/*** PUSH
if (_base && history.pushState) {
base = _base
// Chrome and Safari emit a popstate event on page load, Firefox doesn't.
// Firing popstate after onload is as designed.
//
// See the discussion on https://bugs.webkit.org/show_bug.cgi?id=41372,
// https://code.google.com/p/chromium/issues/detail?id=63040
// and the change to the HTML5 spec that was made:
// http://html5.org/tools/web-apps-tracker?from=5345&to=5346.
window.onpopstate = checkUrl
} else
//*/
if ("onhashchange" in window && !ie6_7) {
// There are onhashchange in IE7 but its not get emitted
//
// Basic support:
// Chrome 5.0, Firefox (Gecko) 3.6 (1.9.2), IE 8.0, Opera 10.6, Safari 5.0
window.onhashchange = checkUrl
} else {
if (ie6_7) {
// IE<9 encounters the Mixed Content warning when the URI javascript: is used.
// IE5/6 additionally encounters the Mixed Content warning when the URI about:blank is used.
// src="//:"
iframe = document.body.appendChild(document.createElement('<iframe class="hide" tabindex="-1">')).contentWindow
cb = _cb
/*** PUSH
if (_base && history.pushState) {
base = _base
// Chrome and Safari emit a popstate event on page load, Firefox doesn't.
// Firing popstate after onload is as designed.
//
// See the discussion on https://bugs.webkit.org/show_bug.cgi?id=41372,
// https://code.google.com/p/chromium/issues/detail?id=63040
// and the change to the HTML5 spec that was made:
// http://html5.org/tools/web-apps-tracker?from=5345&to=5346.
window.onpopstate = checkUrl
} else
//*/
if ("onhashchange" in window && !ie6_7) {
// There are onhashchange in IE7 but its not get emitted
//
// Basic support:
// Chrome 5.0, Firefox 3.6, IE 8, Opera 10.6, Safari 5.0
window.onhashchange = checkUrl
} else {
if (ie6_7 && !iframe) {
// IE<9 encounters the Mixed Content warning when the URI javascript: is used.
// IE5/6 additionally encounters the Mixed Content warning when the URI about:blank is used.
// src="//:"
iframe = document.body.appendChild(document.createElement('<iframe class="hide" tabindex="-1">')).contentWindow
}
clearInterval(tick)
tick = setInterval(function(){
var cur = getUrl()
if (iframe && last === cur) cur = getUrl(iframe.location)
if (last !== cur) {
last = cur
iframe ? setUrl(cur) : checkUrl()
}
tick = setInterval(function(){
var cur = getUrl()
if (iframe && last === cur) cur = getUrl(iframe.location)
if (last !== cur) {
last = cur
iframe ? setUrl(cur) : checkUrl()
}
}, 60)
}
}, 60)
}
cb = _cb
checkUrl()

@@ -129,0 +124,0 @@ }

/*! litejs.com/MIT-LICENSE.txt */
!function(l,g,e){function d(a){a=(a||m).href.split("#")[1]||"";a=decodeURIComponent(a.replace(/\+/g," "));return a.replace(q,"")}function n(a,c){a=encodeURIComponent(a).replace(/%20/g,"+").replace(/%2F/gi,"/");m[c?"replace":"assign"]("#"+a);if(b&&d()!==d(b.location))b.location[c?"replace":b.document.open().close(),"assign"]("#"+a);f()}function f(){h!=(h=d())&&c&&c(h)}var c,h,b,k,m=location,q=/^[#\/\!]+|[\s\/]+$/g,p=!+"\v1"&&8>(g.documentMode||1);e.getUrl=d;e.setUrl=n;e.start=function(a,e){c||("onhashchange"in
l&&!p?l.onhashchange=f:(p&&(b=g.body.appendChild(g.createElement('<iframe class="hide" tabindex="-1">')).contentWindow),setInterval(function(){var a=d();b&&k===a&&(a=d(b.location));k!==a&&(k=a,b?n(a):f())},60)));c=a;f()}}(this,document,history);
!function(l,a,d){function c(b){return((b||m).href.split("#")[1]||"").replace(r,"")}function n(e,a){m[a?"replace":"assign"]("#"+e);if(b&&c()!==c(b.location))b.location[a?"replace":b.document.open().close(),"assign"]("#"+e);f()}function f(){g!=(g=c())&&h&&h(g)}var h,g,b,p,k,m=location,r=/^[#\/\!]+|[\s\/]+$/g,q=!+"\v1"&&8>(a.documentMode||1);d.getUrl=c;d.setUrl=n;d.start=function(e,d){h=e;"onhashchange"in l&&!q?l.onhashchange=f:(q&&!b&&(b=a.body.appendChild(a.createElement('<iframe class="hide" tabindex="-1">')).contentWindow),
clearInterval(p),p=setInterval(function(){var a=c();b&&k===a&&(a=c(b.location));k!==a&&(k=a,b?n(a):f())},60));f()}}(this,document,history);
/*! litejs.com/MIT-LICENSE.txt */
!function(k,l,e){function c(a){a=f?m.pathname.slice(f.length):(a||m).href.split("#")[1]||"";a=decodeURIComponent(a.replace(/\+/g," "));return a.replace(t,"")}function q(a,d){a=encodeURIComponent(a).replace(/%20/g,"+").replace(/%2F/gi,"/");if(f)e[d?"replaceState":"pushState"](null,null,f+a);else if(m[d?"replace":"assign"]("#"+a),b&&c()!==c(b.location))b.location[d?"replace":b.document.open().close(),"assign"]("#"+a);g()}function g(){n!=(n=c())&&h&&h(n)}var h,f,n,b,p,m=location,t=/^[#\/\!]+|[\s\/]+$/g,
r=!+"\v1"&&8>(l.documentMode||1);e.getUrl=c;e.setUrl=q;e.start=function(a,d){h||(d&&e.pushState?(f=d,k.onpopstate=g):"onhashchange"in k&&!r?k.onhashchange=g:(r&&(b=l.body.appendChild(l.createElement('<iframe class="hide" tabindex="-1">')).contentWindow),setInterval(function(){var a=c();b&&p===a&&(a=c(b.location));p!==a&&(p=a,b?q(a):g())},60)));h=a;g()}}(this,document,history);
!function(h,k,d){function c(b){return(f?l.pathname.slice(f.length):(b||l).href.split("#")[1]||"").replace(u,"")}function q(e,a){if(f)d[a?"replaceState":"pushState"](null,null,f+e);else if(l[a?"replace":"assign"]("#"+e),b&&c()!==c(b.location))b.location[a?"replace":b.document.open().close(),"assign"]("#"+e);g()}function g(){m!=(m=c())&&n&&n(m)}var n,f,m,b,r,p,l=location,u=/^[#\/\!]+|[\s\/]+$/g,t=!+"\v1"&&8>(k.documentMode||1);d.getUrl=c;d.setUrl=q;d.start=function(e,a){n=e;a&&d.pushState?(f=a,h.onpopstate=
g):"onhashchange"in h&&!t?h.onhashchange=g:(t&&!b&&(b=k.body.appendChild(k.createElement('<iframe class="hide" tabindex="-1">')).contentWindow),clearInterval(r),r=setInterval(function(){var a=c();b&&p===a&&(a=c(b.location));p!==a&&(p=a,b?q(a):g())},60));g()}}(this,document,history);

@@ -5,4 +5,4 @@

/*
* @version 0.1.4
* @date 2015-04-23
* @version 0.1.5
* @date 2016-03-09
* @stability 2 - Unstable

@@ -53,5 +53,2 @@ * @author Lauri Rooden <lauri@rooden.ee>

//*/
// Fix decode
// http://unixpapa.com/js/querystring.html
url = decodeURIComponent(url.replace(/\+/g, " "))
return url.replace(clean_route, "")

@@ -61,3 +58,2 @@ }

function setUrl(url, replace) {
url = encodeURIComponent(url).replace(/%20/g, "+").replace(/%2F/gi, "/")
//** PUSH

@@ -88,40 +84,39 @@ if (base) {

history.start = function(_cb, _base) {
if (!cb) {
//** PUSH
if (_base && history.pushState) {
base = _base
// Chrome and Safari emit a popstate event on page load, Firefox doesn't.
// Firing popstate after onload is as designed.
//
// See the discussion on https://bugs.webkit.org/show_bug.cgi?id=41372,
// https://code.google.com/p/chromium/issues/detail?id=63040
// and the change to the HTML5 spec that was made:
// http://html5.org/tools/web-apps-tracker?from=5345&to=5346.
window.onpopstate = checkUrl
} else
//*/
if ("onhashchange" in window && !ie6_7) {
// There are onhashchange in IE7 but its not get emitted
//
// Basic support:
// Chrome 5.0, Firefox (Gecko) 3.6 (1.9.2), IE 8.0, Opera 10.6, Safari 5.0
window.onhashchange = checkUrl
} else {
if (ie6_7) {
// IE<9 encounters the Mixed Content warning when the URI javascript: is used.
// IE5/6 additionally encounters the Mixed Content warning when the URI about:blank is used.
// src="//:"
iframe = document.body.appendChild(document.createElement('<iframe class="hide" tabindex="-1">')).contentWindow
cb = _cb
//** PUSH
if (_base && history.pushState) {
base = _base
// Chrome and Safari emit a popstate event on page load, Firefox doesn't.
// Firing popstate after onload is as designed.
//
// See the discussion on https://bugs.webkit.org/show_bug.cgi?id=41372,
// https://code.google.com/p/chromium/issues/detail?id=63040
// and the change to the HTML5 spec that was made:
// http://html5.org/tools/web-apps-tracker?from=5345&to=5346.
window.onpopstate = checkUrl
} else
//*/
if ("onhashchange" in window && !ie6_7) {
// There are onhashchange in IE7 but its not get emitted
//
// Basic support:
// Chrome 5.0, Firefox 3.6, IE 8, Opera 10.6, Safari 5.0
window.onhashchange = checkUrl
} else {
if (ie6_7 && !iframe) {
// IE<9 encounters the Mixed Content warning when the URI javascript: is used.
// IE5/6 additionally encounters the Mixed Content warning when the URI about:blank is used.
// src="//:"
iframe = document.body.appendChild(document.createElement('<iframe class="hide" tabindex="-1">')).contentWindow
}
clearInterval(tick)
tick = setInterval(function(){
var cur = getUrl()
if (iframe && last === cur) cur = getUrl(iframe.location)
if (last !== cur) {
last = cur
iframe ? setUrl(cur) : checkUrl()
}
tick = setInterval(function(){
var cur = getUrl()
if (iframe && last === cur) cur = getUrl(iframe.location)
if (last !== cur) {
last = cur
iframe ? setUrl(cur) : checkUrl()
}
}, 60)
}
}, 60)
}
cb = _cb
checkUrl()

@@ -128,0 +123,0 @@ }

{
"name": "browser-history-lite",
"version": "0.1.4",
"version": "0.1.5",
"stability": 2,

@@ -5,0 +5,0 @@ "author": "Lauri Rooden <lauri@rooden.ee>",

@version 0.1.4
@date 2015-04-23
@version 0.1.5
@date 2016-03-09
@stability 2 - Unstable

@@ -6,0 +6,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc