rcmaehl / MSEdgeRedirect

A Tool to Redirect News, Search, Widgets, Weather and More to Your Default Browser
https://MSEdgeRedirect.com
GNU Lesser General Public License v3.0
4.09k stars 93 forks source link

Unable to intercept MSEdge.exe launched via sihost.exe #143

Closed Yannik closed 1 year ago

Yannik commented 2 years ago

Preflight Checklist

Install Type

New Install

Install Mode

Active Mode

Steps to reproduce

Open link in the windows settings

Example links where this occurs:

Screenshot from 2022-06-05 01-15-56

✔️ Expected Behavior

Links should open in Firefox

❌ Actual Behavior

Edge is opened, but the link is not opened (the tab says "crashed")

Microsoft Windows version

Windows 11 21H2 build 22000.708

Other Software

No response

rcmaehl commented 2 years ago

I'll take a look. Thanks!

gnpaone commented 2 years ago

I have a different experience with this same issue Previous version (last updated 2-3 weeks back - nightly version) gave this error (that error occurs two times - these 2 windows opens and closes within a second): image Latest nightly version opens the edge browser with that white screen as seen in the screenshot (no error) and the edge closes immediately after a second P.S. I'm in 25131 dev build as well as links from Windows updates page

trallnag commented 2 years ago

Animation

Interestingly if I open Edge and then click on the Help link in the settings app Edge goes into focus and a new tab opens to a bing search.

https://www.bing.com/search?q=change%20taskbar%20color%20windows%2011%20site:microsoft.com&form=B00032&ocid=SettingsHAQ-BingIA&mkt=en-US
rcmaehl commented 2 years ago
  • EdgeRedirect: 0.7.0.1
  • Edge: 104.0.1293.47

This looks like you're running Service Mode. Is that right? If possible, can you upload %localappdata%\MSEdgeRedirect\Logs

trallnag commented 2 years ago

@rcmaehl, here you go. I deleted all logs and then clicked again on the link / button that is failing.

logs.zip

URIFailures.log

2022/08/11 20:19:26 - Invalid URL: --type=crashpad-handler --user-data-dir=C:\Users\timsc\AppData\Local\Microsoft\Edge\User Data /prefetch:7 --monitor-self-annotation=ptype=crashpad-handler --database=C:\Users\timsc\AppData\Local\Microsoft\Edge\User Data\Crashpad --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=104.0.5112.81 --annotation=exe=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --annotation=plat=Win64 --annotation=prod=Microsoft Edge --annotation=ver=104.0.1293.47 --initial-client-data=0x130,0x134,0x138,0x10c,0x140,0x7ffc8e8d8250,0x7ffc8e8d8260,0x7ffc8e8d8270
2022/08/11 20:19:26 - Invalid URL: --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --mojo-platform-channel-handle=2100 --field-trial-handle=2200,i,2577272280514638276,4106256247201887788,131072 /prefetch:3
2022/08/11 20:19:26 - Invalid URL: --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --mojo-platform-channel-handle=3852 --field-trial-handle=2200,i,2577272280514638276,4106256247201887788,131072 /prefetch:3

AppSecurity.log

2022/08/11 20:19:26 - Blocked Unsafe URL: --type=crashpad-handler --user-data-dir=C:\Users\timsc\AppData\Local\Microsoft\Edge\User Data /prefetch:7 --monitor-self-annotation=ptype=crashpad-handler --database=C:\Users\timsc\AppData\Local\Microsoft\Edge\User Data\Crashpad --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=104.0.5112.81 --annotation=exe=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --annotation=plat=Win64 --annotation=prod=Microsoft Edge --annotation=ver=104.0.1293.47 --initial-client-data=0x130,0x134,0x138,0x10c,0x140,0x7ffc8e8d8250,0x7ffc8e8d8260,0x7ffc8e8d8270
2022/08/11 20:19:26 - Blocked Unsafe URL: --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --mojo-platform-channel-handle=2100 --field-trial-handle=2200,i,2577272280514638276,4106256247201887788,131072 /prefetch:3
2022/08/11 20:19:26 - Blocked Unsafe URL: --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --mojo-platform-channel-handle=3852 --field-trial-handle=2200,i,2577272280514638276,4106256247201887788,131072 /prefetch:3
trallnag commented 2 years ago

And here again, but with Edge open in the background.

logs.zip

URIFailures.log

2022/08/11 20:23:35 - Invalid URL: --type=crashpad-handler --user-data-dir=C:\Users\timsc\AppData\Local\Microsoft\Edge\User Data /prefetch:7 --monitor-self-annotation=ptype=crashpad-handler --database=C:\Users\timsc\AppData\Local\Microsoft\Edge\User Data\Crashpad --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=104.0.5112.81 --annotation=exe=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --annotation=plat=Win64 --annotation=prod=Microsoft Edge --annotation=ver=104.0.1293.47 --initial-client-data=0x130,0x134,0x138,0x10c,0x140,0x7ffc8e8d8250,0x7ffc8e8d8260,0x7ffc8e8d8270

AppSecurity.log

2022/08/11 20:23:35 - Blocked Unsafe URL: --type=crashpad-handler --user-data-dir=C:\Users\timsc\AppData\Local\Microsoft\Edge\User Data /prefetch:7 --monitor-self-annotation=ptype=crashpad-handler --database=C:\Users\timsc\AppData\Local\Microsoft\Edge\User Data\Crashpad --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=104.0.5112.81 --annotation=exe=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --annotation=plat=Win64 --annotation=prod=Microsoft Edge --annotation=ver=104.0.1293.47 --initial-client-data=0x130,0x134,0x138,0x10c,0x140,0x7ffc8e8d8250,0x7ffc8e8d8260,0x7ffc8e8d8270
Mipsters commented 2 years ago

good catch guys! was about to report the same thing :)

found more links in windows insider menus Settings > Windows Update > Windows Insider Program under "Related support", click on "Becoming a Windows Insider" or "Leave the insider program"

"Becoming a Windows Insider" links to "https://insider.windows.com/getting-started" (redirects to https://insider.windows.com/<language-code>/getting-started)

"Leave the insider program" links to "https://insider.windows.com/leave-program" (redirects to https://insider.windows.com/<language-code>/leave-program)

Windows: 22H2 build 22622.575 Edge: 104.0.1293.54 (64-bit) EdgeRedirect: 0.7.0.1 (Active mode)

edge closed

AppSecurity.log:

2022/08/13 13:00:45 - Blocked Unsafe URL: --type=crashpad-handler --user-data-dir=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data /prefetch:7 --monitor-self-annotation=ptype=crashpad-handler --database=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data\Crashpad --metrics-dir=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=104.0.5112.81 --annotation=exe=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --annotation=plat=Win64 --annotation=prod=Microsoft Edge --annotation=ver=104.0.1293.54 --initial-client-data=0x114,0x118,0x11c,0xf0,0x124,0x7ffe15fc8250,0x7ffe15fc8260,0x7ffe15fc8270
2022/08/13 13:00:45 - Blocked Unsafe URL: --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --mojo-platform-channel-handle=2352 --field-trial-handle=2004,i,10614741675680621460,6631899872687424811,131072 /prefetch:3
2022/08/13 13:00:46 - Blocked Unsafe URL: --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --mojo-platform-channel-handle=3932 --field-trial-handle=2004,i,10614741675680621460,6631899872687424811,131072 /prefetch:3

URIFailures.log:

2022/08/13 13:00:45 - Invalid URL: --type=crashpad-handler --user-data-dir=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data /prefetch:7 --monitor-self-annotation=ptype=crashpad-handler --database=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data\Crashpad --metrics-dir=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=104.0.5112.81 --annotation=exe=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --annotation=plat=Win64 --annotation=prod=Microsoft Edge --annotation=ver=104.0.1293.54 --initial-client-data=0x114,0x118,0x11c,0xf0,0x124,0x7ffe15fc8250,0x7ffe15fc8260,0x7ffe15fc8270
2022/08/13 13:00:45 - Invalid URL: --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --mojo-platform-channel-handle=2352 --field-trial-handle=2004,i,10614741675680621460,6631899872687424811,131072 /prefetch:3
2022/08/13 13:00:46 - Invalid URL: --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --mojo-platform-channel-handle=3932 --field-trial-handle=2004,i,10614741675680621460,6631899872687424811,131072 /prefetch:3

edge open

AppSecurity.log:

2022/08/13 13:09:07 - Blocked Unsafe URL: --type=crashpad-handler --user-data-dir=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data /prefetch:7 --monitor-self-annotation=ptype=crashpad-handler --database=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data\Crashpad --metrics-dir=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=104.0.5112.81 --annotation=exe=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --annotation=plat=Win64 --annotation=prod=Microsoft Edge --annotation=ver=104.0.1293.54 --initial-client-data=0x128,0x12c,0x130,0x104,0x138,0x7ffe3cd48250,0x7ffe3cd48260,0x7ffe3cd48270

URIFailures.log:

2022/08/13 13:09:07 - Invalid URL: --type=crashpad-handler --user-data-dir=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data /prefetch:7 --monitor-self-annotation=ptype=crashpad-handler --database=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data\Crashpad --metrics-dir=C:\Users\<Username>\AppData\Local\Microsoft\Edge\User Data --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=104.0.5112.81 --annotation=exe=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --annotation=plat=Win64 --annotation=prod=Microsoft Edge --annotation=ver=104.0.1293.54 --initial-client-data=0x128,0x12c,0x130,0x104,0x138,0x7ffe3cd48250,0x7ffe3cd48260,0x7ffe3cd48270
Mipsters commented 2 years ago

I looked at it abit seems like Windows Settings runs the following command

"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --single-argument microsoft-edge:https://insider.windows.com/getting-started

I checked @trallnag example, its the same form with a different url after "microsoft-edge:"

EDIT: I got the above results by replacing msedge.exe with a small program that prints the arguments that it receives what's interesting is that when I used that same program as the debugger of msedge.exe, it didn't show those results, only crush reports that came after it this is pretty weird, maybe its because the call comes from a system program so it "dodges" the debugger?

rcmaehl commented 1 year ago

Hi all this should be fixed. If not, please let me know!

Yannik commented 1 year ago

Hi @rcmaehl

Great!

Could you point me to the change which fixes this issue?

Yannik commented 1 year ago

@rcmaehl Atleast with release 0.7.2.0 this does not seem to be fixed. Links from the settings page are sometimes opening correctly in edge, sometimes an window opens and immediately closes (+ --type=crashpad-handler entries in URIFailures.log)

Yannik commented 1 year ago

I have built the latest master branch (64b685b) myself, the issue still persists.

rcmaehl commented 1 year ago

I have built the latest master branch (64b685b) myself, the issue still persists.

Is it those two links still. I've been unable to reproduce on my end:

cantrepo

If you haven't already, please run the Cleanup tool and then reinstall:

https://raw.githubusercontent.com/rcmaehl/MSEdgeRedirect/main/Assets/Cleanup%20Tool.ps1

Yannik commented 1 year ago

@rcmaehl please check the links in the OP: https://user-images.githubusercontent.com/801996/172028462-0dd65e68-c830-42dd-a3ce-a12e2fdf0a28.png

These are the ones I was testing

Yannik commented 1 year ago

@rcmaehl I have run Cleanup Tool and then reinstalled the latest master. The issue still persists with the Settings -> Privacy and Security -> Managing Account Privacy settings / Change Account Privacy settings links.

Remzi1993 commented 1 year ago

Preflight Checklist

  • [x] Microsoft Edge is still installed (see issue 26)
  • [x] Running microsoft-edge:https://google.com redirects successfully
  • [ ] Microsoft Edge is selected in any "How do you want to open this?" box (if applicable)

Install Type

New Install

Install Mode

Active Mode

Steps to reproduce

Open link in the windows settings

Example links where this occurs:

Screenshot from 2022-06-05 01-15-56

✔️ Expected Behavior

Links should open in Firefox

❌ Actual Behavior

Edge is opened, but the link is not opened (the tab says "crashed")

Microsoft Windows version

Windows 11 21H2 build 22000.708

Other Software

No response

I have the exact same behaviour after installing redirect. I hope this gets fixed. I'm on the latest stable build of Windows 11, build: 22621.963

rch77 commented 1 year ago

I have the same issue with 0.7.3.0 Active Mode, Firefox as default browser, Windows Home 11 10.22621. Trying to open any link in Settings like "Getting new wallpapers every day from Microsoft" without Edge window currently open results in blank window flashing for a second and disappearing. It doesn't crash but opens new tab if Edge is already opened. Crash event ID 1000 in Event Log:

Faulting application name: msedge.exe, version: 111.0.1661.54, time stamp: 0x641d5ed2
Faulting module name: msedge.dll, version: 111.0.1661.54, time stamp: 0x641d5ed2
Exception code: 0x80000003
Fault offset: 0x0000000002093a2d
Faulting process id: 0x0x3F40
Faulting application start time: 0x0x1D96458A05ABD69
Faulting application path: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
Faulting module path: C:\Program Files (x86)\Microsoft\Edge\Application\111.0.1661.54\msedge.dll
Report Id: c8d81d61-e5a9-4f19-9f4d-f8ec6522a85f
Faulting package full name: 
Faulting package-relative application ID: 
Yannik commented 1 year ago

@rcmaehl Do you an idea how to fix this?

rcmaehl commented 1 year ago

There's been some changes on IFEO handling for the upcoming release. If you're having the issue, can you test out the dev build and let me know if it's improved at all?

https://github.com/rcmaehl/MSEdgeRedirect/suites/11747883615/artifacts/612058373

rch77 commented 1 year ago

It looks the same. Faulting application name: msedge.exe, version: 111.0.1661.62, time stamp: 0x6424ce40 Faulting module name: msedge.dll, version: 111.0.1661.62, time stamp: 0x6424ce40 Exception code: 0x80000003 Fault offset: 0x00000000020b3f3d Faulting process id: 0x0x3D94 Faulting application start time: 0x0x1D96656F0130C3E Faulting application path: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe Faulting module path: C:\Program Files (x86)\Microsoft\Edge\Application\111.0.1661.62\msedge.dll Report Id: 8e36e487-b4b6-4475-92ee-2511130c4948 Faulting package full name: Faulting package-relative application ID:

On Mon, Apr 3, 2023 at 1:57 PM Robert C. Maehl @.***> wrote:

There's been some changes on IFEO handling for the upcoming release. If you're having the issue, can you test out the dev build and let me know if it's improved at all?

https://github.com/rcmaehl/MSEdgeRedirect/suites/11747883615/artifacts/612058373

— Reply to this email directly, view it on GitHub https://github.com/rcmaehl/MSEdgeRedirect/issues/143#issuecomment-1494742612, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT6NWDW5TUKP6FI7QE52DCTW7MFPNANCNFSM5X4ER76Q . You are receiving this because you commented.Message ID: @.***>

rcmaehl commented 1 year ago

Was able to reproduce. Working on it

rcmaehl commented 1 year ago

Interestingly enough... MSEdgeRedirect is being launched... just somehow being killed.

image

rcmaehl commented 1 year ago

So it appears in certain situations sihost is directly launching edge.

I might be able to work around this...

HarshalKudale commented 1 year ago

Is MSedgeRedirect recieving the arguments in case of failure? I tried replacing MSedgeRedirect with a cpp program that just shows args passed to it. If what you saying is the case app will not recieve the args so settings links will only work in service mode

rcmaehl commented 1 year ago

In this specific case, the msedge.exe launched by sihost.exe has already "consumed" the arguments we need. We have enough time to recover them however.

rcmaehl commented 1 year ago

BINGO 👏

Yannik commented 1 year ago

@rcmaehl that's great! Does this fix work for both active and service mode?

Yannik commented 1 year ago

@rcmaehl one more thing... I tried to test this using the "download testing" link on the main repo page, but that seems to be broken.

rcmaehl commented 1 year ago

@rcmaehl that's great! Does this fix work for both active and service mode?

It should

rcmaehl commented 1 year ago

@rcmaehl one more thing... I tried to test this using the "download testing" link on the main repo page, but that seems to be broken.

The download itself, or installing the version from the download. If referring to the download itself, I'm aware... it seems to be in limbo of working and not working due to smartscreen / safe browsing.

Yannik commented 1 year ago

The download. Now it's working though.

Yannik commented 1 year ago

@rcmaehl Your patch does fix things, however, there are two caveats:

If I understood your explanations correctly, it seems like the first call to msedge.exe is evading the IFEO debugger, correct? Would it not be the nicer solution to fix this, instead of using this workaround?

rcmaehl commented 1 year ago

@rcmaehl Your patch does fix things, however, there are two caveats:

  • there is a brief flash of an edge window
  • sometimes (couldn't reliably reproduce this) two tabs are opened for clicking a link once

If I understood your explanations correctly, it seems like the first call to msedge.exe is evading the IFEO debugger, correct? Would it not be the nicer solution to fix this, instead of using this workaround?

Yes. I'm still investigating why the first call isn't using the IFEO debugger, but this workaround re-enables the broken functionality until I figure out a fix to the avoidance (if possible)

Yannik commented 1 year ago

Hi Robert,

makes sense to me. Should I open a separate new issue for this?

I had one more look at the IFEO config: Could the IFEO debugger not being triggered possibly be caused by the FilterFullPath option?

rcmaehl commented 1 year ago

Hi Robert,

makes sense to me. Should I open a separate new issue for this?

I had one more look at the IFEO config: Could the IFEO debugger not being triggered possibly be caused by the FilterFullPath option?

Shouldn't be.