Skip to content

Commit

Permalink
Fix/disable iframes support for now (#1881)
Browse files Browse the repository at this point in the history
* disable iframes for now

* Disable sending messages to iframes for now
  • Loading branch information
andrepimenta authored Oct 15, 2020
1 parent 07d153f commit 0351a3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/components/Views/BrowserTab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,12 @@ export const BrowserTab = props => {
backgroundBridges.current.push(newBridge);
};

/**
* Disabling iframes for now
const onFrameLoadStarted = url => {
url && initializeBackgroundBridge(url, false);
};
*/

/**
* Is the current tab the active tab
Expand Down Expand Up @@ -1285,11 +1288,13 @@ export const BrowserTab = props => {
}

switch (data.type) {
/**
* Disabling iframes for now
case 'FRAME_READY': {
const { url } = data.payload;
onFrameLoadStarted(url);
break;
}
}*/
case 'GET_WEBVIEW_URL':
webviewUrlPostMessagePromiseResolve.current &&
webviewUrlPostMessagePromiseResolve.current(data.payload);
Expand Down
6 changes: 5 additions & 1 deletion app/util/browserScripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ export const JS_POST_MESSAGE_TO_PROVIDER = (message, origin) => `(function () {
}
})()`;

export const JS_IFRAME_POST_MESSAGE_TO_PROVIDER = (message, origin) => `(function () {
export const JS_IFRAME_POST_MESSAGE_TO_PROVIDER = (message, origin) => `(function () {})()`;
/** Disable sending messages to iframes for now
*
`(function () {
const iframes = document.getElementsByTagName('iframe');
for (let frame of iframes){
Expand All @@ -127,3 +130,4 @@ export const JS_IFRAME_POST_MESSAGE_TO_PROVIDER = (message, origin) => `(functio
}
})()`;
*/

1 comment on commit 0351a3e

@Snugface
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason for which this commit is still relevant in 2022?
It would be great to get web3 to be injected into the iframes, as it currently is not.

Please sign in to comment.