@lit-protocol/misc-browser
Advanced tools
Comparing version 6.4.1 to 6.4.2-pr-621
@@ -24,13 +24,11 @@ { | ||
], | ||
"version": "6.4.1", | ||
"version": "6.4.2-pr-621", | ||
"dependencies": { | ||
"@ethersproject/abstract-provider": "5.7.0", | ||
"@lit-protocol/accs-schemas": "0.0.9", | ||
"@lit-protocol/contracts": "^0.0.39", | ||
"@openagenda/verror": "^3.1.4", | ||
"ethers": "^5.7.1", | ||
"jszip": "^3.10.1", | ||
"siwe": "^2.0.5", | ||
"@lit-protocol/constants": "6.4.1", | ||
"@lit-protocol/types": "6.4.1", | ||
"@lit-protocol/uint8arrays": "6.4.1", | ||
"@lit-protocol/constants": "6.4.2-pr-621", | ||
"@lit-protocol/types": "6.4.2-pr-621", | ||
"@lit-protocol/uint8arrays": "6.4.2-pr-621", | ||
"tslib": "1.14.1" | ||
@@ -37,0 +35,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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
15364
8
273
1
+ Added@openagenda/verror@^3.1.4
+ Added@lit-protocol/constants@6.4.2-pr-621(transitive)
+ Added@lit-protocol/types@6.4.2-pr-621(transitive)
+ Added@lit-protocol/uint8arrays@6.4.2-pr-621(transitive)
+ Added@openagenda/verror@3.1.4(transitive)
+ Addedassertion-error@1.1.0(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addedsprintf-js@1.1.3(transitive)
- Removed@lit-protocol/accs-schemas@0.0.9
- Removed@lit-protocol/contracts@^0.0.39
- Removedjszip@^3.10.1
- Removed@lit-protocol/accs-schemas@0.0.9(transitive)
- Removed@lit-protocol/constants@6.4.1(transitive)
- Removed@lit-protocol/contracts@0.0.39(transitive)
- Removed@lit-protocol/types@6.4.1(transitive)
- Removed@lit-protocol/uint8arrays@6.4.1(transitive)
- Removedajv@8.17.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-uri@3.0.6(transitive)
- Removedimmediate@3.0.6(transitive)
- Removedisarray@1.0.0(transitive)
- Removedjson-schema-traverse@1.0.0(transitive)
- Removedjszip@3.10.1(transitive)
- Removedlie@3.3.0(transitive)
- Removedpako@1.0.11(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedrequire-from-string@2.0.2(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedtypescript@5.7.3(transitive)
- Removedutil-deprecate@1.0.2(transitive)