1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 04:46:10 +01:00
metamask-extension/test/e2e/mock-page-with-disallowed-iframe/index.html
Mark Stacey 5a5e541b5e Fix e2e tests
The e2e tests have been updated for `@metamask/phishing-warning@1.1.0`.
The iframe case was updated with a new design, which required test
changes. The third test that was meant to ensure the phishing page
can't redirect to an extension page has been updated to navigate
directly to the phishing warning page and setting the URL manually via
query parameters, as that was the only way to test that redirect.
2022-05-16 18:48:20 -02:30

21 lines
636 B
HTML

<!doctype html>
<html lang="en">
<head>
<title>Mock E2E Phishing Page</title>
</head>
<script type="text/javascript">
function setIframeSource() {
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());
const extensionUrl = new URL(params.extensionUrl);
document.getElementById('frame').src = `http://localhost:9999/#hostname=${encodeURIComponent(extensionUrl.hostname)}&href=${encodeURIComponent(extensionUrl.href)}`;
}
window.onload = setIframeSource;
</script>
<body>
<div>Hello</div>
<iframe id="frame" width=900 height=900>
</body>
</html>