Skip to content

Commit

Permalink
fix(webiew): incorrect condition for window.open js script
Browse files Browse the repository at this point in the history
  • Loading branch information
tymmesyde committed Feb 23, 2025
1 parent ae5e8eb commit 8ef0f07
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/stremio_app/stremio_wevbiew/wevbiew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,19 @@ impl PartialUi for WebView {
}catch(e){}
window.open = (url) => {
if (typeof url === 'string' && URL.canParse(url))
if (typeof url === 'string' && URL.canParse(url)) {
try {
const message = {
id: 1,
args: ['open-external', url],
};
window.chrome.webview.postMessage(JSON.stringify(message));
} catch(e) {
console.error('Failed to post message');
}
} else {
return console.error('Not a valid URL string');
try {
const message = {
id: 1,
args: ['open-external', url],
};
window.chrome.webview.postMessage(JSON.stringify(message));
} catch(e) {
console.error('Failed to post message');
}
};
Expand Down

0 comments on commit 8ef0f07

Please sign in to comment.