Skip to content

Commit ff9cb7e

Browse files
committed
On Embedded, use location provided origin
1 parent 2d2bb4f commit ff9cb7e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

extension/src/content/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,22 @@ async function _init(localConfigs: Promise<object>) {
4444
setupStyles('content.styles.css')
4545
// setupStyles(configs.WEB_CSS_CONFIG_URL, false)
4646

47+
const isEmbedded = chrome.isPolyfill? true : false
4748
let origin = window.location.origin
4849
try {
4950
const MetabaseBootstrap = JSON.parse(document.getElementById("_metabaseBootstrap").textContent)
5051
const siteUrl = MetabaseBootstrap['site-url']
51-
if (siteUrl && !isEmpty(siteUrl)) {
52+
if (!isEmbedded && siteUrl && !isEmpty(siteUrl)) {
5253
origin = siteUrl
5354
}
5455
} catch (e) {
5556
console.warn('[minusx] MetabaseBootstrap not found, using window location origin')
5657
}
58+
console.log('[minusx] Origin:', origin)
5759
const href = window.location.href
5860
const width = '350'
5961
const variant = 'default'
6062

61-
const isEmbedded = chrome.isPolyfill? true : false
6263
const iframeInfo: IframeInfo = {
6364
tool,
6465
toolVersion,

0 commit comments

Comments
 (0)