Socket
Socket
Sign inDemoInstall

addressbar

Package Overview
Dependencies
0
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.8 to 0.1.9

18

index.js

@@ -20,2 +20,3 @@ var EventEmitter = require('events').EventEmitter;

var prevUrl = location.href;
var currentSetUrl = null;

@@ -57,3 +58,9 @@ var emitChange = function (url) {

isSilent = true;
history.replaceState({url: prevUrl, index: index}, '', prevUrl.replace(origin, ''));
// If not set any new url, meaning its just prevented,
// revert url
if (currentSetUrl !== location.href) {
history.replaceState({url: prevUrl, index: index}, '', prevUrl.replace(origin, ''));
}
}

@@ -77,5 +84,13 @@

set: function (value) {
if (value.indexOf(origin) === -1) {
value = origin + value;
}
currentSetUrl = value;
if (value === location.href) {
return;
}
if (!doReplace) {

@@ -89,2 +104,3 @@ history.pushState({url: value, index: index++}, '', value.replace(origin, ''));

isPreventingDefault = false;
}

@@ -91,0 +107,0 @@ });

2

package.json
{
"name": "addressbar",
"version": "0.1.8",
"version": "0.1.9",
"description": "Makes the addressbar of the browser work just like a normal input",

@@ -5,0 +5,0 @@ "main": "index.js",

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