some debugging
This commit is contained in:
parent
54e2fa6626
commit
3aae1aafc1
6 changed files with 16 additions and 9 deletions
Binary file not shown.
Binary file not shown.
|
|
@ -1,3 +1,8 @@
|
|||
## 14.0.13
|
||||
|
||||
- fixes for restart logic
|
||||
- fixed top context check in case of crossdomain placement
|
||||
|
||||
## 14.0.11 & .12
|
||||
|
||||
- fix for node maintainer stability around `#document` nodes (mainly iframes field)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@openreplay/tracker",
|
||||
"description": "The OpenReplay tracker main package",
|
||||
"version": "14.0.13-beta.3",
|
||||
"version": "14.0.14-0",
|
||||
"keywords": [
|
||||
"logging",
|
||||
"replay"
|
||||
|
|
|
|||
|
|
@ -30,11 +30,4 @@ export default class IFrameObserver extends Observer {
|
|||
this.app.send(CreateIFrameDocument(rootNodeId, docID))
|
||||
})
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
if (this.docId !== undefined) {
|
||||
this.app.send(RemoveNode(this.docId))
|
||||
}
|
||||
super.disconnect()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,6 +95,14 @@ function processOptions(obj: any): obj is Options {
|
|||
return true
|
||||
}
|
||||
|
||||
const canAccessTop = () => {
|
||||
try {
|
||||
return Boolean(window.top)
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
export default class API {
|
||||
public featureFlags: FeatureFlags
|
||||
|
||||
|
|
@ -104,11 +112,12 @@ export default class API {
|
|||
constructor(private readonly options: Options) {
|
||||
this.crossdomainMode = Boolean(inIframe() && options.crossdomain?.enabled)
|
||||
if (!IN_BROWSER || !processOptions(options)) {
|
||||
console.error('OpenReplay: tracker called in a non-browser environment or with invalid options')
|
||||
return
|
||||
}
|
||||
if (
|
||||
(window as any).__OPENREPLAY__ ||
|
||||
(!this.crossdomainMode && inIframe() && (window.top as any)?.__OPENREPLAY__)
|
||||
(!this.crossdomainMode && inIframe() && canAccessTop() && (window.top as any)?.__OPENREPLAY__)
|
||||
) {
|
||||
console.error('OpenReplay: one tracker instance has been initialised already')
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue