diff options
author | Alex Yatskov <alex@foosoft.net> | 2020-02-24 21:31:14 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2020-02-24 21:31:14 -0800 |
commit | d32f4def0eeed1599857bc04c973337a2a13dd8b (patch) | |
tree | 61149656f361dd2d9998d67d68249dc184b73fbb /ext/bg/js/settings/popup-preview.js | |
parent | 0c5b9b1fa1599cbf769d96cdebc226310f9dd8bc (diff) | |
parent | 706c3edcffb0078d71fd5b58775f16cf5fc1205b (diff) |
Merge branch 'master' into testing
Diffstat (limited to 'ext/bg/js/settings/popup-preview.js')
-rw-r--r-- | ext/bg/js/settings/popup-preview.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/bg/js/settings/popup-preview.js b/ext/bg/js/settings/popup-preview.js index 0d20471e..d1d2ff5e 100644 --- a/ext/bg/js/settings/popup-preview.js +++ b/ext/bg/js/settings/popup-preview.js @@ -40,20 +40,22 @@ function showAppearancePreview() { window.wanakana.bind(text[0]); + const targetOrigin = chrome.runtime.getURL('/').replace(/\/$/, ''); + text.on('input', () => { const action = 'setText'; const params = {text: text.val()}; - frame.contentWindow.postMessage({action, params}, '*'); + frame.contentWindow.postMessage({action, params}, targetOrigin); }); customCss.on('input', () => { const action = 'setCustomCss'; const params = {css: customCss.val()}; - frame.contentWindow.postMessage({action, params}, '*'); + frame.contentWindow.postMessage({action, params}, targetOrigin); }); customOuterCss.on('input', () => { const action = 'setCustomOuterCss'; const params = {css: customOuterCss.val()}; - frame.contentWindow.postMessage({action, params}, '*'); + frame.contentWindow.postMessage({action, params}, targetOrigin); }); container.append(frame); |