Brave: synchronize settings when backend is "Provided by Brave" #1281
Labels
area/brave
Issues related to Brave Browser
exp/expert
Having worked on the specific codebase is important
kind/discussion
Topical discussion; usually not changes to codebase
kind/enhancement
A net-new feature or improvement to an existing feature
P1
High: Likely tackled by core team if no one steps up
post-mv3
Tasks to be done after MV3 release
Brave IPFS SOW 2023 has an item about exposing IPFS settings from
brave://settings/ipfs
to IPFS Companion extension.We want to be able to read them, and to change them programmatically.
I've described feature request details in brave/brave-browser#31199, and the feature was implemented recently in brave/brave-core#18901.
List of new APIs
New
chrome.ipfs
methods are available (brave-browser-beta-1.59.92 or later) ONLY to IPFS Companion Extension ID.These are privileged APIs that are NOT available to other extensions.
Reading IPFS Settings
chrome.ipfs.getSettings(callback)
- returns a JSON with IPFS-related settings in Bravechrome.ipfs.getSettings((a) => console.log(a))
→{"auto_redirect_to_configured_gateway":false,"gateway_auto_fallback_enabled":false,"gateway_url":"https://dweb.link","nft_gateway_url":"https://nftstorage.link","resolve_method":"local","storage_max":1}
Writing IPFS Settings
WRITING is limited to a subset of settings:
chrome.ipfs.setPublicGateway
- sets current public gateway urlchrome.ipfs.setPublicNFTGateway
- sets current public NFT gateway url (iiuc this is a privacy feature where images in Brave Wallet are not triggering fetch to local IPFS node, we probably should not touch this)chrome.ipfs.setResolveMethod("local" | "gateway" | "ask" | "disabled")
- sets IPFS resolution type ("local" here means Kubo node embedded in Brave, and "gateway" mean some other URL, it could be localhost from IPFS Desktop used by regular companion users).chrome.ipfs.setAutoRedirectToConfiguredGatewayEnabled(true|false)
- sets auto redirect settingchrome.ipfs.setGatewayFallbackEnabled(true|false)
- sets gateway fallback setting (fall back to public IPFS gateway if your Brave local IPFS node cannot be reached)What IPFS Companion should do with them
We should synchronize gateway URLs and ensure redirect logic in brave and companion extension are not in conflict when "Provided by Brave" backend is used:
chrome.ipfs.setAutoRedirectToConfiguredGatewayEnabled(false)
)FAQ
brave://settings(.*)
is open, and keep pollinggetSettings
for updates every second, for as long the tab is open.#shared-pl-brave
on SlackThe text was updated successfully, but these errors were encountered: