From a3719486d07a8904513b66de2592e059381eef03 Mon Sep 17 00:00:00 2001 From: Amit <4527660+amitbl@users.noreply.github.com> Date: Sun, 27 May 2018 17:40:21 +0300 Subject: [PATCH] switch to document.location.origin --- src/scripts/content_script.js | 2 +- src/scripts/inject.js | 2 +- src/scripts/seed.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/content_script.js b/src/scripts/content_script.js index ee262fd..286eb46 100644 --- a/src/scripts/content_script.js +++ b/src/scripts/content_script.js @@ -50,7 +50,7 @@ from: 'BLOCKTUBE_CONTENT', type: 'storageData', data: compiledStorage || globalStorage, - }, `https://${document.domain}`); + }, document.location.origin); }, inject() { const s = document.createElement('script'); diff --git a/src/scripts/inject.js b/src/scripts/inject.js index 659a5ac..4392938 100644 --- a/src/scripts/inject.js +++ b/src/scripts/inject.js @@ -464,7 +464,7 @@ // !! Utils function postMessage(type, data) { - window.postMessage({ from: 'BLOCKTUBE_PAGE', type, data }, `https://${document.domain}`); + window.postMessage({ from: 'BLOCKTUBE_PAGE', type, data }, document.locaion.origin); } function getObjectByPath(obj, path, def = undefined) { diff --git a/src/scripts/seed.js b/src/scripts/seed.js index 24473c2..9ca5dc1 100644 --- a/src/scripts/seed.js +++ b/src/scripts/seed.js @@ -116,7 +116,7 @@ } function postMessage(type, data) { - window.postMessage({ from: 'BLOCKTUBE_PAGE', type, data }, `https://${document.domain}`); + window.postMessage({ from: 'BLOCKTUBE_PAGE', type, data }, document.location.origin); } if (window.writeEmbed || window.ytplayer || window.Polymer) {