Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

can-route-pushstate

Package Overview
Dependencies
Maintainers
5
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-route-pushstate - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

12

can-route-pushstate.js

@@ -19,2 +19,3 @@ // # can/route/pushstate/pushstate.js

var namespace = require('can-util/namespace');
var LOCATION = require('can-util/dom/location/location');

@@ -25,5 +26,5 @@ var canEvent = require('can-event');

var hasPushstate = window.history && window.history.pushState;
var location = route.location || window.location;
var loc = LOCATION();
var validProtocols = { 'http:': true, 'https:': true, '': true };
var usePushStateRouting = hasPushstate && location && validProtocols[location.protocol];
var usePushStateRouting = hasPushstate && loc && validProtocols[loc.protocol];

@@ -95,5 +96,7 @@ // Initialize plugin only if browser supports pushstate.

var absolute = url.indexOf("http") === 0;
var searchHash = window.location.search + window.location.hash;
var loc = LOCATION();
var searchHash = loc.search + loc.hash;
// If url differs from current call original histoy method and update `route` state.
if ((!absolute && url !== window.location.pathname + searchHash) || (absolute && url !== window.location.href + searchHash)) {
if ((!absolute && url !== loc.pathname + searchHash) ||
(absolute && url !== loc.href + searchHash)) {
originalMethods[method].apply(window.history, arguments);

@@ -127,2 +130,3 @@ route.setState();

var root = cleanRoot(),
location = LOCATION(),
loc = (location.pathname + location.search),

@@ -129,0 +133,0 @@ index = loc.indexOf(root);

{
"name": "can-route-pushstate",
"version": "3.0.2",
"version": "3.0.3",
"description": "Pushstate for can-route",

@@ -39,3 +39,3 @@ "homepage": "https://canjs.com",

"can-route": "^3.0.0",
"can-util": "^3.0.1"
"can-util": "^3.3.0"
},

@@ -42,0 +42,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc