*Abort if theres no page url

This commit is contained in:
Derrick Hammer 2022-08-22 03:57:15 -04:00
parent c7589158d2
commit e6f32a41c3
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,9 @@ export default function setup(engine: WebEngine) {
}); });
browser.menus.onShown.addListener((details: Menus.OnShownInfoType) => { browser.menus.onShown.addListener((details: Menus.OnShownInfoType) => {
if (!details.pageUrl) {
return;
}
const provider = engine.getDomainContentProvider( const provider = engine.getDomainContentProvider(
new URL(details.pageUrl as string).hostname new URL(details.pageUrl as string).hostname
); );