Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Commit 8fa726f

Browse files
Make message type in PostMessage plugin configurable
1 parent 6262490 commit 8fa726f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/library/src/plugins/postmessage.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
export default class PostMessage {
2-
constructor({ origin, target }) {
2+
constructor({ origin, target, messageType }) {
33
this.origin = origin || '*'
44
this.target = target || window.parent
5+
this.messageType = messageType || 'labjs.data'
56
}
67

78
handle(context, event) {
89
if (event === 'epilogue') {
910
this.target.postMessage({
10-
type: 'labjs.data',
11+
type: this.messageType,
1112
metadata: {
1213
payload: 'full',
1314
url: window.location.href,

0 commit comments

Comments
 (0)