Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify devtools.panels.create() path resolution #20617

Merged

Conversation

rebloor
Copy link
Contributor

@rebloor rebloor commented Aug 28, 2023

Summary

Adds browser variation clarifications originally proposed in mdn/content#20552

@rebloor rebloor added the data:webext Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions label Aug 28, 2023
@rebloor rebloor requested a review from jpmedley August 28, 2023 17:34
@rebloor rebloor self-assigned this Aug 28, 2023
@jpmedley jpmedley removed their request for review August 28, 2023 19:11
@bsmth bsmth self-requested a review September 1, 2023 15:47
@bsmth
Copy link
Member

bsmth commented Sep 1, 2023

I can take a look on Monday if that's okay? Set myself as a reviewer so I don't forget about it.

@rebloor
Copy link
Contributor Author

rebloor commented Sep 1, 2023

Thanks @bsmth

@bsmth
Copy link
Member

bsmth commented Sep 4, 2023

Noting that options is set to mirror for Fx android, https://github.com/mdn/browser-compat-data/blob/459da79f9ec222665fc90151e7f37fc7ae26e1d4/webextensions/api/devtools.json#L68C20-L68C35 while false for all other features - I'm guessing this should be false also?

"support": {
"chrome": {
"version_added": true,
"notes": "URL always resolved as absolute."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggestion in the related PR states this may also be relative to the extension directory and the extensions docs say a URL "relative to the extension directory"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsmth within the context of a web extension they are the same thing e.g. "you can specify the path as an absolute URL, starting at the extension's root, like this: /path/to/stylesheet.css" e.g. the extension root is the starting point. Hence we have statements such as "When a content script makes an HTTP(S) request, you must provide absolute URLs." in the web extensions docs.

@rebloor
Copy link
Contributor Author

rebloor commented Sep 6, 2023

@bsmth

Noting that options is set to mirror for Fx android, https://github.com/mdn/browser-compat-data/blob/459da79f9ec222665fc90151e7f37fc7ae26e1d4/webextensions/api/devtools.json#L68C20-L68C35 while false for all other features - I'm guessing this should be false also?

Probably "should be" (given that Firefox for Android will almost certainly never support devtools.) However, you can't make that change because the linter considers it to be an error:

 ✖ webextensions.api.devtools.inspectedWindow.eval.options - Error → Data for firefox_android can be automatically mirrored, use "firefox_android": "mirror" instead```
and If you attempt to commit the change the linter automatically "fixes" the issue prior to committing.

@bsmth
Copy link
Member

bsmth commented Sep 7, 2023

If you attempt to commit the change the linter automatically "fixes" the issue prior to committing.

You're right, I guess we're forced to mirror unless there is support in Firefox and a need to disambiguate.

edit: this lives here btw: https://github.com/mdn/browser-compat-data/blob/main/test/linter/test-mirror.ts

Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you! Merging shortly 👍🏻

@bsmth bsmth merged commit 1a3564f into mdn:main Sep 7, 2023
Elchi3 pushed a commit to Elchi3/browser-compat-data that referenced this pull request Nov 14, 2023
@rebloor rebloor deleted the Clarify-devtools.panels.create()-path-resolution branch January 9, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:webext Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants