forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Portals: Block cross-origin postMessage
Updates implementation to drop messages sent to/from a portal that is cross origin with its host, and updates WPTs to reflect this change. Bug: 1108793 Change-Id: Ie0056c7a01a4d65cccdbfb0a0044b3d6afc87497 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2382064 Commit-Queue: Adithya Srinivasan <[email protected]> Reviewed-by: Jeremy Roman <[email protected]> Reviewed-by: Lucas Gadani <[email protected]> Reviewed-by: Alex Moshchuk <[email protected]> Reviewed-by: Ken Buchanan <[email protected]> Cr-Commit-Position: refs/heads/master@{#804405}
- Loading branch information
1 parent
06b4935
commit f346773
Showing
8 changed files
with
71 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!DOCTYPE html> | ||
<script> | ||
window.portalHost.postMessage('test message', '*'); | ||
</script> |
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
portals/resources/portal-post-message-x-origin-portal.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<script src="stash-utils.sub.js"></script> | ||
<script> | ||
const queryParams = new URLSearchParams(window.location.search); | ||
const key = queryParams.get('key'); | ||
if (key) { | ||
window.portalHost.onmessage = () => { | ||
StashUtils.putValue(key, 'failed'); | ||
}; | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters