-
Notifications
You must be signed in to change notification settings - Fork 885
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
Handle microsoft-edge: protocol on Windows #9778
Conversation
463868d
to
1d82c6f
Compare
|
735cf40
to
1441f35
Compare
17d42e5
to
15e9692
Compare
chromium_src/chrome/browser/ui/startup/startup_browser_creator.cc
Outdated
Show resolved
Hide resolved
15e9692
to
4bd077b
Compare
4bd077b
to
1f6d2a5
Compare
When Brave is set as a default app for microsoft-edge protocol, Windows will pass "microsoft-edge:XXX" as command line arguments. This edge protocol includes url information. To make browser load passed url included in edge protocol, browser should parse url info from ms-edge protocol args and appends url alone to command line again. Then, that url will be loaded during the startup process.
With this, brave will be visible in the microsoft-edge target app list in control panel.
BraveMainDelegate::BasicStartupComplete() is not called again when browser is already running. So, it's not good place to handle command line args. Instead, StartupBrowserCreatorImpl::Launch() is proper place to get url from command line.
1f6d2a5
to
0068900
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some nits to fix
chromium_src/chrome/browser/ui/startup/startup_browser_creator.cc
Outdated
Show resolved
Hide resolved
0068900
to
05e5767
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All done. Thanks @goodov :)
chromium_src/chrome/browser/ui/startup/startup_browser_creator.cc
Outdated
Show resolved
Hide resolved
05e5767
to
3ebce84
Compare
3ebce84
to
fef40c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build installer, installed, and gave it a full run! This works great 🙂 Really nice work here
When Brave is set as a default app for microsoft-edge protocol,
Windows will pass "microsoft-edge:XXX" as command line arguments.
This edge protocol includes url information.
To make browser load passed url included in edge protocol, browser
should parse ms-edge protocol args fetch url from it.
Then, new browser or existing browser window will load that url.
Resolves brave/brave-browser#13875
Security review: https://github.com/brave/security/issues/552
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
npm run test brave_unit_tests -- --filter=*MSEdgeProtocolTest*
Use the Windows
Defaults
program to set themicrosoft-edge
handler manuallyTest 1 - from chrome uninstall process
Test 2 - search from windows task bar
Test 3 - uninstall