Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit a8b3f40

Browse files
committed
push a message to the iframe to force it to reload
1 parent 569526e commit a8b3f40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

public/listeners/synclisteners.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ function connectContentSync() {
114114
// when receiving a message from WebSocket reload the current frame adding the received timestamp
115115
// as a request var to, hopefully, bust caches... cachi(?)
116116
wsc.onmessage = function (event) {
117-
document.getElementById('sg-viewport').contentWindow.location.reload();
117+
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
118+
document.getElementById('sg-viewport').contentWindow.postMessage( { "reload": true }, targetOrigin);
118119
}
119120

120121
// when there's an error update the pattern lab nav bar

0 commit comments

Comments
 (0)