Skip to content

Commit

Permalink
fix embed
Browse files Browse the repository at this point in the history
  • Loading branch information
HyunsDev committed May 27, 2021
1 parent 6a98836 commit 41d78b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion block/notion-tools-block-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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}`)
} )
Expand Down

0 comments on commit 41d78b4

Please sign in to comment.