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

Register with the DE as a scheme handler #114

Merged
merged 2 commits into from
Sep 4, 2024
Merged

Conversation

John-LittleBearLabs
Copy link
Collaborator

@John-LittleBearLabs John-LittleBearLabs commented Aug 19, 2024

It's going to be difficult to test this prior to doing release builds.

Allows new hist policy.
Also CLI.

Fixes #110
Copy link

codecov bot commented Aug 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.31%. Comparing base (bf32996) to head (cf03085).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
+ Coverage   48.15%   50.31%   +2.15%     
==========================================
  Files         490      477      -13     
  Lines       17748    16093    -1655     
  Branches     1977     1750     -227     
==========================================
- Hits         8547     8097     -450     
+ Misses       8577     7440    -1137     
+ Partials      624      556      -68     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

for these schemes with desktop env.
So users click links.

Fixes #113
if (LSSetDefaultHandlerForURLScheme(CFSTR("https"), identifier) != noErr) {
return false;
}
+ LSSetDefaultHandlerForURLScheme(CFSTR("ipfs"), identifier);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In this PR, one does actually need to pay attention to the chromium_edits/ folder.

As you can tell from the _mac.mm suffix, this file is specific to Mac OS.

Type=Application
Categories=Network;WebBrowser;
-MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
+MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ipfs;x-scheme-handler/ipns;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This file is specific to Linux. It becomes ipfs_chromium.desktop after @@VARIABLE@@ substitution.

This line registers it as a able to handle these mime types & schemes, so if/when the desktop environment asks you which thing to open a thing with (as in xdg-open), it'll provide ipfs-chromium as an option.

Somewhat separate concept from default browser.

-const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {L"http", L"https",
- nullptr};
+const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {
+ L"http", L"https", L"ipfs", L"ipns", nullptr};
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This file is not OS-specific, but it seems like Windows keeps a bit closer to it.

@John-LittleBearLabs John-LittleBearLabs changed the base branch from websafe to main September 3, 2024 16:42
@John-LittleBearLabs John-LittleBearLabs merged commit 9a0a8b0 into main Sep 4, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants