From 41d78b49aefb61d325e331443e1bd62693f935c3 Mon Sep 17 00:00:00 2001 From: Hyuns Date: Thu, 27 May 2021 22:45:43 +0900 Subject: [PATCH] fix embed --- block/notion-tools-block-module.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/block/notion-tools-block-module.js b/block/notion-tools-block-module.js index 71152ea..fdcd3e4 100644 --- a/block/notion-tools-block-module.js +++ b/block/notion-tools-block-module.js @@ -21,12 +21,17 @@ function apply_theme() { } } +var our_url; if (window.location != window.parent.location) { out_url = document.referrer } else { out_url = document.location.href } +if (!out_url) { + out_url = document.location.ancestorOrigins[0] +} + $.ajax({ url: 'https://api2.notion-tools.com/v1/embed', data: { @@ -36,7 +41,7 @@ $.ajax({ type: "POST", dataType: "json" }).done(json => { - console.log("Server connection successful") + console.log(json) }).fail((xhr, status, errorThrown) => { console.log(`Server connect fail ${status} ${errorThrown}`) } )