AveYo / fox

Firefox stuff
725 stars 69 forks source link

Does nothing when I searched from StartMenu #13

Closed ivAkii closed 2 years ago

soulctcher commented 2 years ago

Same here. Nothing happens at all after the change is enabled. It doesn't bring up Edge, but it doesn't bring up the default browser and search, either.

AveYo commented 2 years ago

make sure your default browser is actually set as default in windows settings
some details would be nice, like the script used, os, browser, av, language - you know - the bare minimum to turn this issue actionable

soulctcher commented 2 years ago

Can't speak for the other person, but the script used was ChrEdgeFkOff.cmd from this very git. OS: Windows 11 Home 21H2 22000.856 Browser: Firefox 103.0.2 (64-bit), and yes, it's set to the default for both HTTP & HTTPS AV: Defender Language: English

The script gives a positive result when installing, but as I said above, literally nothing happens when a search in Windows is then executed other than the Start menu goes away.

AveYo commented 2 years ago

enter these in a cmd / ps and post output:

reg query "HKCU\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice"
reg query "HKCR\microsoft-edge" /s
reg query "HKCR\MSEdgeHTM" /s
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe\0"
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ie_to_edge_stub.exe\0"
cmd /c "dir ""%programdata%\ChrEdgeFkOff.vbs"""
cmd /c "dir ""%programdata%\ie_to_edge_stub.exe"""
Marko1st commented 2 years ago

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice ProgID REG_SZ FirefoxURL-308046B0AF4A39CB Hash REG_SZ shxeZz527cs=

HKEY_CLASSES_ROOT\microsoft-edge (Default) REG_SZ URL:microsoft-edge NoOpenWith REG_SZ URL Protocol REG_SZ

HKEY_CLASSES_ROOT\microsoft-edge\shell

HKEY_CLASSES_ROOT\microsoft-edge\shell\open

HKEY_CLASSES_ROOT\microsoft-edge\shell\open\command (Default) REG_SZ "C:\ProgramData\ie_to_edge_stub.exe" %1

HKEY_CLASSES_ROOT\MSEdgeHTM (Default) REG_SZ Microsoft Edge HTML Document AppUserModelId REG_SZ MSEdge NoOpenWith REG_SZ

HKEY_CLASSES_ROOT\MSEdgeHTM\Application AppUserModelId REG_SZ MSEdge ApplicationIcon REG_SZ C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe,0 ApplicationName REG_SZ Microsoft Edge ApplicationDescription REG_SZ Browse the web ApplicationCompany REG_SZ Microsoft Corporation

HKEY_CLASSES_ROOT\MSEdgeHTM\DefaultIcon (Default) REG_SZ C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe,0

HKEY_CLASSES_ROOT\MSEdgeHTM\shell

HKEY_CLASSES_ROOT\MSEdgeHTM\shell\open

HKEY_CLASSES_ROOT\MSEdgeHTM\shell\open\command (Default) REG_SZ "C:\ProgramData\ie_to_edge_stub.exe" %1

HKEY_CLASSES_ROOT\MSEdgeHTM\shell\runas ProgrammaticAccessOnly REG_SZ

HKEY_CLASSES_ROOT\MSEdgeHTM\shell\runas\command (Default) REG_SZ "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --do-not-de-elevate --single-argument %1

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe\0 FilterFullPath REG_SZ C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe Debugger REG_SZ wscript.exe "C:\ProgramData\ChrEdgeFkOff.vbs" //B //T:60

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ie_to_edge_stub.exe\0 FilterFullPath REG_SZ C:\ProgramData\ie_to_edge_stub.exe Debugger REG_SZ wscript.exe "C:\ProgramData\ChrEdgeFkOff.vbs" //B //T:60

Volume in drive C has no label. Volume Serial Number is 38BC-C5B9

Directory of C:\ProgramData

08/15/2022 21:31 42 ChrEdgeFkOff.vbs 1 File(s) 42 bytes 0 Dir(s) 356,390,182,912 bytes free Volume in drive C has no label. Volume Serial Number is 38BC-C5B9

Directory of C:\ProgramData

08/10/2022 21:10 509,368 ie_to_edge_stub.exe 1 File(s) 509,368 bytes 0 Dir(s) 356,390,182,912 bytes free

AveYo commented 2 years ago
08/15/2022 21:31 42 ChrEdgeFkOff.vbs
1 File(s) 42 bytes

The script in your case is just 42 bytes, so that's the issue. You could manually edit it with the proper content:

' ChrEdgeFkOff v4 - make start menu web search, widgets links or help open in your chosen default browser - by AveYo
Dim A,F,CLI,URL,decode,utf8,char,u,u1,u2,u3,ProgID,Choice : CLI = "": URL = "": For i = 1 to WScript.Arguments.Count - 1
A = WScript.Arguments(i): CLI = CLI & " " & A: If InStr(1, A, "microsoft-edge:", 1) Then: URL = A: End If: Next

decode = Split(URL,"%"): u = 0: Do While u <= UBound(decode): If u <> 0 Then
char = Left(decode(u),2): If "&H" & Left(char,2) >= 128 Then
decode(u) = "": u = u + 1: char = char & Left(decode(u),2): If "&H" & Left(char,2) < 224 Then
u1 = Cint("&H" & Left(char,2)) Mod 32: u2 = Cint("&H" & Mid(char,3,2)) Mod 64: utf8 = ChrW(u2 + u1 * 64)
Else: decode(u) = "": u = u + 1: char = char & Left(decode(u),4): u1 = Cint("&H" & Left(char,2)) Mod 16
u2 = Cint("&H" & Mid(char,3,2)) Mod 32: u3 = Cint("&H" & Mid(char,5,2)) Mod 64: utf8 = ChrW(u3 + (u2 + u1 * 64) * 64): End If
Else: utf8 = Chr("&H" & char): End If: decode(u) = utf8 & Mid(decode(u),3)
End If: u = u + 1: Loop: URL = Trim(Join(decode,"")) ' stackoverflow . com /questions/17880395

On error resume next
Set W = CreateObject("WScript.Shell"): F = Split(URL,"://",2,1): If UBound(F) > 0 Then URL = F(1)
ProgID = W.RegRead("HKCU\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice\ProgID")
Choice = W.RegRead("HKCR\" & ProgID & "\shell\open\command\"): ProgID = W.RegRead("HKCR\MSEdgeMHT\shell\open\command\")
If Instr(1,ProgID,Chr(34),1) Then ProgID = Split(ProgID,Chr(34))(1) Else ProgID = Split(ProgID,Chr(32))(1)
If Instr(1,Choice,ProgID,1) Then URL = "": End If: ProgID = Replace(ProgID,"msedge.exe","chredge.exe")
If URL = "" Then W.Run """" & ProgID & """ " & Trim(CLI), 1, False Else W.Run """https://" & URL & """", 1, False
' done
Marko1st commented 2 years ago

That worked for me! I'm not super tech savvy, so apologies if this doesn't make sense... but the original copying and pasting of the script into PS seemed to only create an empty script file in C:\ProgramData labeled 'ChrEdgeFkOff'

AveYo commented 2 years ago

Was it built-in powershell (5.x), or the cross-platform pscore one (7.x) ? In any case, I will see how I can prevent this from happening in the next update.

Marko1st commented 2 years ago

uhhh... whichever one this is... image

soulctcher commented 2 years ago

I can confirm that my C:\ProgramData\ChrEdgeFkOff.vbs was just a bunch of empty lines. Replacing the contents manually did fix the launch of the browser for me as well.

My PowerShell is this one: image

AveYo commented 2 years ago

found the issue with out-file cmdlet (only happened when copy-pasting in ps), should be fixed now!