@frontiertower/frontier-sdk 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Check if the app is running inside a Frontier Wallet iframe
3
- * Verifies both that it's in an iframe and that the parent origin is allowed
3
+ * Simply checks if the window is embedded in an iframe
4
4
  */
5
5
  declare function isInFrontierApp(): boolean;
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Check if the app is running inside a Frontier Wallet iframe
3
- * Verifies both that it's in an iframe and that the parent origin is allowed
3
+ * Simply checks if the window is embedded in an iframe
4
4
  */
5
5
  declare function isInFrontierApp(): boolean;
6
6
  /**
@@ -28,32 +28,8 @@ __export(ui_utils_exports, {
28
28
  module.exports = __toCommonJS(ui_utils_exports);
29
29
 
30
30
  // src/ui-utils/detection.ts
31
- var ALLOWED_ORIGINS = [
32
- "http://localhost:5173",
33
- "https://sandbox.wallet.frontiertower.io",
34
- "https://alpha.wallet.frontiertower.io",
35
- "https://beta.wallet.frontiertower.io",
36
- "https://wallet.frontiertower.io"
37
- ];
38
31
  function isInFrontierApp() {
39
- if (window.parent === window) {
40
- return false;
41
- }
42
- try {
43
- const parentOrigin = document.referrer ? new URL(document.referrer).origin : null;
44
- if (parentOrigin && ALLOWED_ORIGINS.includes(parentOrigin)) {
45
- return true;
46
- }
47
- if (window.parent.location.origin && ALLOWED_ORIGINS.includes(window.parent.location.origin)) {
48
- return true;
49
- }
50
- } catch (e) {
51
- if (document.referrer) {
52
- const referrerOrigin = new URL(document.referrer).origin;
53
- return ALLOWED_ORIGINS.includes(referrerOrigin);
54
- }
55
- }
56
- return false;
32
+ return window.self !== window.top;
57
33
  }
58
34
  function getParentOrigin() {
59
35
  try {
@@ -1,30 +1,6 @@
1
1
  // src/ui-utils/detection.ts
2
- var ALLOWED_ORIGINS = [
3
- "http://localhost:5173",
4
- "https://sandbox.wallet.frontiertower.io",
5
- "https://alpha.wallet.frontiertower.io",
6
- "https://beta.wallet.frontiertower.io",
7
- "https://wallet.frontiertower.io"
8
- ];
9
2
  function isInFrontierApp() {
10
- if (window.parent === window) {
11
- return false;
12
- }
13
- try {
14
- const parentOrigin = document.referrer ? new URL(document.referrer).origin : null;
15
- if (parentOrigin && ALLOWED_ORIGINS.includes(parentOrigin)) {
16
- return true;
17
- }
18
- if (window.parent.location.origin && ALLOWED_ORIGINS.includes(window.parent.location.origin)) {
19
- return true;
20
- }
21
- } catch (e) {
22
- if (document.referrer) {
23
- const referrerOrigin = new URL(document.referrer).origin;
24
- return ALLOWED_ORIGINS.includes(referrerOrigin);
25
- }
26
- }
27
- return false;
3
+ return window.self !== window.top;
28
4
  }
29
5
  function getParentOrigin() {
30
6
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontiertower/frontier-sdk",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "SDK for building apps on Frontier Wallet",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",