Handle absolute calendar item action popup URLs#69
Open
DeBaschdi wants to merge 1 commit into
Open
Conversation
calendar_item_action.default_popup can already resolve to an absolute URL after localization. Passing that value through extension.getURL() again prefixes it with the extension base URL and produces an invalid nested moz-extension URL. Keep absolute popup URLs unchanged and only resolve relative manifest paths through extension.getURL().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This fixes
calendar_item_action.default_popuphandling when the localized popup value is already an absolute URL.The current implementation always passes the localized
default_popupvalue throughextension.getURL(). That works for relative manifest paths, but it breaks if localization or manifest processing already produced an absolute extension URL such asmoz-extension://.../popup.html.In that case,
extension.getURL()treats the absolute URL as a path and prefixes it with the extension base URL again. The resulting popup URL contains a nested extension URL and points to a non-existing resource.Example result:
Opening the calendar item action popup then fails because Thunderbird tries to load that invalid URL.
What changed
The popup value is now localized first and then checked:
extension.getURL(...)This keeps the existing behavior for normal relative
default_popupmanifest entries while avoiding invalid nested URLs for already resolved absolute popup URLs.Why this fixes the issue
default_popupcan validly be represented in two forms at this point:ui/popup.htmlmoz-extension://.../ui/popup.htmlOnly the relative form needs
extension.getURL(). Callingextension.getURL()on an already absolute URL changes its meaning and creates an invalid resource path.By preserving absolute URLs and resolving only relative paths, the calendar item action popup receives a loadable URL in both cases.