Offer ability to add permission when using `@pixiebrix/get` and other bricks
The error surfaced by the @pixiebrix/get is not actionable:
Current fix:
- Visit the URL (hoping you won't be redirected elsewhere)
- Open editor
- Click on the "Enable PB" button
Ideal fix:
- Show "Enable PB on this domain" button next to the error (or in its place). Maybe via
ErrorDisplay?
Side quest:
- [ ] Make it work even if it redirects across domains. 😬 For example the url
https://fregante.comredirects tohttps://twitter.com, so I think adding a permission forfregante.com/*is not enough or not necessary at all. I'm not sure whether this is fixable since we don't have access to the final URL thatfetchrequests.
Current fix
This fixes it for your current browser install, but does not fix it if you were to redeploy on another computer.
Ideal fix
When the user clicks the button , the Page Editor needs to add the origin to the permissions.origins declaration on the extension: https://docs.pixiebrix.com/developer-guide/multi-page-automation#e9f10aaf9a7d4127ad0af9106b6b5297
We'll need to update the:
Other considerations:
- We want this to work for both
@pixiebrix/getand@pixiebrix/httpbricks. (Or composite bricks that use those under the hood) - From a security perspective: in the case of a redirect, the Page Editor should prompt 2x: first time for the initial URL, and for the redirected URL.
Related Issues:
- https://github.com/pixiebrix/pixiebrix-extension/issues/3037
Very related issue:
- https://github.com/pixiebrix/pixiebrix-extension/issues/2043
Reopening because there's still no way to add a permission. It's clear (even to me) how to add a permission. Can we add this button when the error is detected?