Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit b386f0c

Browse files
authored
Merge pull request #5657 from matrix-org/t3chguy/usercontent
Remove redundant lockOrigin parameter from usercontent
2 parents fbf0a73 + 6cb3381 commit b386f0c

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/components/views/messages/MFileBody.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export default class MFileBody extends React.Component {
288288
<a ref={this._dummyLink} />
289289
</div>
290290
<iframe
291-
src={`${url}?origin=${encodeURIComponent(window.location.origin)}`}
291+
src={url}
292292
onLoad={onIframeLoad}
293293
ref={this._iframe}
294294
sandbox="allow-scripts allow-downloads allow-downloads-without-user-activation" />

src/usercontent/index.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
const params = window.location.search.substring(1).split('&');
2-
let lockOrigin;
3-
for (let i = 0; i < params.length; ++i) {
4-
const parts = params[i].split('=');
5-
if (parts[0] === 'origin') lockOrigin = decodeURIComponent(parts[1]);
6-
}
7-
81
function remoteRender(event) {
92
const data = event.data;
103

@@ -45,7 +38,7 @@ function remoteSetTint(event) {
4538
}
4639

4740
window.onmessage = function(e) {
48-
if (e.origin === lockOrigin) {
41+
if (e.origin === window.location.origin) {
4942
if (e.data.blob) remoteRender(e);
5043
else remoteSetTint(e);
5144
}

0 commit comments

Comments
 (0)