New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@lit-protocol/misc-browser

Package Overview
Dependencies
Maintainers
0
Versions
524
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lit-protocol/misc-browser - npm Package Compare versions

Comparing version 6.7.0 to 7.0.0-alpha.0

13

package.json

@@ -24,3 +24,3 @@ {

],
"version": "6.7.0",
"version": "7.0.0-alpha.0",
"dependencies": {

@@ -30,8 +30,9 @@ "@ethersproject/abstract-provider": "5.7.0",

"@lit-protocol/contracts": "^0.0.63",
"@openagenda/verror": "^3.1.4",
"depd": "^2.0.0",
"ethers": "^5.7.1",
"jszip": "^3.10.1",
"siwe": "^2.0.5",
"@lit-protocol/constants": "6.7.0",
"@lit-protocol/types": "6.7.0",
"@lit-protocol/uint8arrays": "6.7.0",
"siwe": "^2.3.2",
"@lit-protocol/constants": "7.0.0-alpha.0",
"@lit-protocol/types": "7.0.0-alpha.0",
"@lit-protocol/uint8arrays": "7.0.0-alpha.0",
"tslib": "1.14.1"

@@ -38,0 +39,0 @@ },

@@ -21,7 +21,7 @@ "use strict";

if (!item) {
return (0, constants_1.ELeft)({
message: `Failed to get ${key} from local storage`,
errorKind: constants_1.LIT_ERROR.LOCAL_STORAGE_ITEM_NOT_FOUND_EXCEPTION.kind,
errorCode: constants_1.LIT_ERROR.LOCAL_STORAGE_ITEM_NOT_FOUND_EXCEPTION.name,
});
return (0, constants_1.ELeft)(new constants_1.LocalStorageItemNotFoundException({
info: {
storageKey: key,
},
}, `Failed to get %s from local storage`, key));
}

@@ -44,6 +44,7 @@ return (0, constants_1.ERight)(item);

catch (e) {
return (0, constants_1.ELeft)({
message: `Failed to set ${key} in local storage`,
error: constants_1.LIT_ERROR.LOCAL_STORAGE_ITEM_NOT_SET_EXCEPTION,
});
return (0, constants_1.ELeft)(new constants_1.LocalStorageItemNotSetException({
info: {
storageKey: key,
},
}, `Failed to set %s in local storage`, key));
}

@@ -65,6 +66,7 @@ };

catch (e) {
return (0, constants_1.ELeft)({
message: `Failed to remove ${key} from local storage`,
error: constants_1.LIT_ERROR.LOCAL_STORAGE_ITEM_NOT_REMOVED_EXCEPTION,
});
return (0, constants_1.ELeft)(new constants_1.LocalStorageItemNotRemovedException({
info: {
storageKey: key,
},
}, `Failed to remove %s from local storage`, key));
}

@@ -155,7 +157,15 @@ };

// data urls are not safe, refuse to do this
throw new Error('You can not inject an iFrame with a data url. Try a regular https URL.');
throw new constants_1.InvalidArgumentException({
info: {
fileUrl,
},
}, 'You can not inject an iFrame with a data url. Try a regular https URL.');
}
const url = new URL(fileUrl);
if (url.host.toLowerCase() === window.location.host.toLowerCase()) {
throw new Error('You cannot host a LIT on the same domain as the parent webpage. This is because iFrames with the same origin have access to localstorage and cookies in the parent webpage which is unsafe');
throw new constants_1.InvalidArgumentException({
info: {
fileUrl,
},
}, 'You cannot host a LIT on the same domain as the parent webpage. This is because iFrames with the same origin have access to localstorage and cookies in the parent webpage which is unsafe');
}

@@ -162,0 +172,0 @@ const iframe = Object.assign(document.createElement('iframe'), {

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