Skip to content

Commit 6b7cae3

Browse files
authored
fix(event|open-url): allow https only (#25)
1 parent d468944 commit 6b7cae3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ function _handleIFrameEvent({
149149
if (onOpenUrl && typeof onOpenUrl === 'function') {
150150
onOpenUrl({url: payload.url})
151151
} else {
152-
window.open(payload.url, '_blank')
152+
const url = new URL(payload.url)
153+
154+
if ('https:' === url.protocol)
155+
window.open(payload.url, '_blank')
153156
}
154157
break
155158
default:

0 commit comments

Comments
 (0)