Fix "Open in new window" context menu action in release builds #2873
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix "Open in new window" context menu action in release builds
Pull Request Type
Related issue
Partially addresses #2832
Description
In the release builds, all files are accessed using the
file:
protocol, including the index.html file. Interestingly how thenew URL()
class handles file URLs differs depending on the implementation. In node theorigin
field isnull
, in Firefox it's a string with null in it"null"
and in Chromium it'sfile:///
. In release builds, the current implementation was checking if the linkURL containednull
, which it never did, so it always hid the context menu entry.In dev builds the files are served from the webpack dev server (http://localhost:9080) so the previous implementation worked fine there.
Testing
yarn build
Desktop