Skip to content

iframe throws Failed to construct 'URL': Invalid URL in electron app #250

@FrozenKiwi

Description

@FrozenKiwi

Description

My electron app runs fine in dev mode (electron-forge start) but throws when running the exe on the following line:
image

The problem is that e is empty (''), and so the new URL throws with

TypeError: Failed to construct 'URL': Invalid URL

Technical Information

I'm 99% sure the offending line calling this function is this one:

.

The debug console confirms that document.referrer is "".

This could be fixed by changing

const parsed = new URL(url)
to check referrer before constructing the URL, and perhaps returning a default if none exists.

I would be happy to put up a PR if necessary, cause this is bit of a blocker for me and seems to be quite simple to fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions