@lit-protocol/misc-browser
Advanced tools
Comparing version 6.7.0 to 7.0.0-alpha.0
@@ -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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
15577
273
11
1
+ Added@openagenda/verror@^3.1.4
+ Addeddepd@^2.0.0
+ Added@lit-protocol/constants@7.0.0-alpha.0(transitive)
+ Added@lit-protocol/types@7.0.0-alpha.0(transitive)
+ Added@lit-protocol/uint8arrays@7.0.0-alpha.0(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)
- Removedjszip@^3.10.1
- Removed@lit-protocol/constants@6.7.0(transitive)
- Removed@lit-protocol/types@6.7.0(transitive)
- Removed@lit-protocol/uint8arrays@6.7.0(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedimmediate@3.0.6(transitive)
- Removedisarray@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)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
Updatedsiwe@^2.3.2