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

Brave: subresource assets (e.g. images, video, scripts) with gateway URL not redirected #1095

Open
dokterbob opened this issue Sep 5, 2022 · 4 comments
Labels
area/brave Issues related to Brave Browser status/blocked/upstream-bug Blocked by upstream bugs

Comments

@dokterbob
Copy link

Describe the bug
When a website links to assets over IPFS using gateway URL's, they are loaded over the gateway rather than redirected to a configured gateway (e.g. local node).

To Reproduce

  1. Ensure local node is running.
  2. Ensure IPFS Companion is enabled.
  3. Load demo page with link to image on https://dweb.link: https://dweb.link/ipfs/QmaZKqW2KM4P6cynUg7u8htjgn1LvD9io7cVEpjCdpAcDr
  4. Ensure redirect to local node (e.g. http://bafybeifvrn2fj77a7xlhgi3r5yfqdllibcyoozcd65ggzzhdj47rwbirnu.ipfs.localhost:8080/).
  5. Open Network tab in DevTools.
  6. Reload page.
  7. Verify request URL for image on website.

Expected behavior
Image URL is replaced by URL on local node (e.g. http://bafybeifnki7op77j43swrlukkjq7whi5wxae7zys52fqgrsycars656xhq.ipfs.localhost:8080/QmUxhzKtwaDm5T8HnxfVCxogH2K7MshYVdtc1mCaFFFqqm-400-400.webp), as would be the case then the image URL is opened directly, and loaded from there. Instead, it's loaded from the original URL from the remote gateway (e.g. https://bafybeifnki7op77j43swrlukkjq7whi5wxae7zys52fqgrsycars656xhq.ipfs.dweb.link/QmUxhzKtwaDm5T8HnxfVCxogH2K7MshYVdtc1mCaFFFqqm-400-400.webp).

Screenshots
image
image

Desktop:

  • OS: macOS Catalina 10.15.7 (19H2026)
  • Browser: Brave
  • Version: Version 1.43.89 Chromium: 105.0.5195.102 (Official Build) (x86_64)
  • IPFS Companion: v2.19.1

Additional context
I have double checked that with the internet disconnected, the image loads from the direct URL and the demo page loads, but the image does not load on the page.

@dokterbob dokterbob added the need/triage Needs initial labeling and prioritization label Sep 5, 2022
@welcome
Copy link

welcome bot commented Sep 5, 2022

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within seven business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@dokterbob
Copy link
Author

Poke! @whizzzkid @SgtPooki @lidel @armujahid

@whizzzkid
Copy link
Contributor

whizzzkid commented Sep 22, 2022

@dokterbob ❤️ the 👉🏽🧑‍💻 but I don't have perms to assign/triage/label the issue.

For me locally, the redirect seems to be happening to my local gateway url as expected. But the asset is not resolving, 🤔?

@lidel lidel changed the title Linked assets (e.g. images, video, scripts) not redirected Brave: linked assets (e.g. images, video, scripts) not redirected Sep 29, 2022
@lidel
Copy link
Member

lidel commented Sep 29, 2022

iirc this is an artificial limitation present in Brave, caused by their custom Brave Shields extension.

Subresources on https:// websites (e.g., images) that have src pointing at a public gateway URL (with CID in URL) can't be redirected:

Been a few months since I've looked at this, but at the time subresource redirect in Brave worked only when you use native ipns:// and ipfs:// built into Brave (using embedded note instead of remote one).

@dokterbob please fill an upstream issue in https://github.com/brave/brave-browser/issues and mention me there, and I'll bring this topic up during my bi-weekly sync with Brave 🙏

@lidel lidel added status/blocked/upstream-bug Blocked by upstream bugs area/brave Issues related to Brave Browser and removed need/triage Needs initial labeling and prioritization labels Sep 29, 2022
@lidel lidel changed the title Brave: linked assets (e.g. images, video, scripts) not redirected Brave: subresource assets (e.g. images, video, scripts) with gateway URL not redirected Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/brave Issues related to Brave Browser status/blocked/upstream-bug Blocked by upstream bugs
Projects
No open projects
Status: Needs Prep Work / Blocked
Development

No branches or pull requests

3 participants