mirror of
https://github.com/Stremio/stremio-shell-ng.git
synced 2026-03-11 21:27:06 +00:00
fix(webiew): incorrect condition for window.open js script
Some checks failed
Continuous integration / test (push) Has been cancelled
Some checks failed
Continuous integration / test (push) Has been cancelled
This commit is contained in:
parent
ae5e8eb0e4
commit
8ef0f079b6
1 changed files with 12 additions and 11 deletions
|
|
@ -139,9 +139,7 @@ impl PartialUi for WebView {
|
|||
}catch(e){}
|
||||
|
||||
window.open = (url) => {
|
||||
if (typeof url === 'string' && URL.canParse(url))
|
||||
return console.error('Not a valid URL string');
|
||||
|
||||
if (typeof url === 'string' && URL.canParse(url)) {
|
||||
try {
|
||||
const message = {
|
||||
id: 1,
|
||||
|
|
@ -152,6 +150,9 @@ impl PartialUi for WebView {
|
|||
} catch(e) {
|
||||
console.error('Failed to post message');
|
||||
}
|
||||
} else {
|
||||
return console.error('Not a valid URL string');
|
||||
}
|
||||
};
|
||||
|
||||
try{console.log('Shell JS injected');if(window.self === window.top) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue