BeautySearch icon indicating copy to clipboard operation
BeautySearch copied to clipboard

Re-implement online search

Open McBaumwolle opened this issue 3 years ago • 30 comments

If you install BeautySearch, it automatically disables web search. image I think it was intentionally added, but it shouldn't, many people including me use it.

McBaumwolle avatar Aug 22 '20 11:08 McBaumwolle

TL;DR: BeautySearch is incompatible with Bing Online Search.

BeautySearch is built on the fact that Windows Search UI is actually web-based application.
When you install BS, it writes a line to the HTML file of the Search web-app, forcing it to load the BeautySearch script, so we don't need to keep the Installer executable file in memory.

The file we write data to is stored in the Windows folder, but when the Bing Search is enabled, the Search app loads the web-app from Bing instead of the local one every time you open it, so we can't modify it.
The only way to force the Search app use the local web-app is to disable Bing Search, so BS is incompatible with online search.

krlvm avatar Aug 22 '20 12:08 krlvm

Okay, thanks for the info.

McBaumwolle avatar Aug 22 '20 12:08 McBaumwolle

Thanks for the idea, I figured out how to re-implement the web search, even how to add a custom search provider instead of Bing (Google, etc.)

krlvm avatar Aug 22 '20 12:08 krlvm

Awesome! I use Bing, but many people would like to choose their own provider.

McBaumwolle avatar Aug 22 '20 12:08 McBaumwolle

Any updates on this?

Thanks for the idea, I figured out how to re-implement the web search, even how to add a custom search provider instead of Bing (Google, etc.)

astraelise avatar Sep 26 '20 11:09 astraelise

Any updates on this?

Thanks for the idea, I figured out how to re-implement the web search, even how to add a custom search provider instead of Bing (Google, etc.)

I managed to display search results in the Search Window, but I still need to do some research to figure out how to force open the links in an external browser.

krlvm avatar Sep 26 '20 15:09 krlvm

Any updates on this?

Thanks for the idea, I figured out how to re-implement the web search, even how to add a custom search provider instead of Bing (Google, etc.)

I managed to display search results in the Search Window, but I still need to do some research to figure out how to force open the links in an external browser.

I am thrilled for this! Currently, only the missing online search is keeping me from installing your software. Keep up the good work!

TillKnollmann avatar Oct 07 '20 07:10 TillKnollmann

Any updates on this?

Thanks for the idea, I figured out how to re-implement the web search, even how to add a custom search provider instead of Bing (Google, etc.)

I managed to display search results in the Search Window, but I still need to do some research to figure out how to force open the links in an external browser.

very excited to hear this! I like having search results in the start search but I hate how bing has no dark mode so for the time being I'm using duckduckgo and would absolutely love to see it integrated into the system search menu

KibSquib48 avatar Dec 07 '20 22:12 KibSquib48

Are there any new updates on this or is this feature not possible?

Thanks for the idea, I figured out how to re-implement the web search, even how to add a custom search provider instead of Bing (Google, etc.)

astraelise avatar Jan 19 '21 07:01 astraelise

Finally took the time and was able to do some additional reverse engineering - I found a way to call the function that opens a given URL, so I hope to release a new version with Google search support within a few days, depending on time.

It will also support opening some webpages inside the Search Window. Unfortunately, some websites including Google (but I've managed to bypass it) doesn't allow embedding them in iframe, so I'm thinking on bringing an optional component, that'll render the websites instead of the Search App.

On screenshot: Google Search -> a Wikipedia page embedded in the Search Window. image

krlvm avatar Mar 09 '21 18:03 krlvm

I've published a beta version with some limitations.

krlvm avatar Mar 20 '21 19:03 krlvm

I've published a beta version with some limitations.

I have tried it out. The embedded window does not fit the search section and the "search the web" button (which seems to disappear when no local results are found) has to be clicked on for online results. Hope there is a fix

astraelise avatar Mar 21 '21 12:03 astraelise

The embedded window does not fit the search section

Can you provide a screenshot, please?

krlvm avatar Mar 21 '21 13:03 krlvm

The embedded window does not fit the search section

Can you provide a screenshot, please?

image

astraelise avatar Mar 21 '21 14:03 astraelise

not loading SharedScreenshot

senolfndk avatar Aug 08 '21 14:08 senolfndk

@senolfndk Try to restart the Installer and Install it again, if it still not work, you can manually take ownership before installation: https://github.com/krlvm/BeautySearch/issues/11#issuecomment-860113080

krlvm avatar Aug 08 '21 15:08 krlvm

Any news on this?

SOI7 avatar Feb 15 '22 12:02 SOI7

It appears that the WebView which is embedded in Search is configured to disallow loading web pages from local network even when checknetisolation is configured, while it is needed to run a local web server which will add CORS header to Google's responses, because it will not load otherwise. I have an idea of implementing a proxy server instead of the web server and proxy only Search App requests through it with NDIS, but it is a more complex solution.

krlvm avatar Feb 15 '22 12:02 krlvm

It appears that the WebView which is embedded in Search is configured to disallow loading web pages from local network even when checknetisolation is configured, while it is needed to run a local web server which will add CORS header to Google's responses, because it will not load otherwise. I have an idea of implementing a proxy server instead of the web server and proxy only Search App requests through it with NDIS, but it is a more complex solution.

Does this affect only Google, or web engines in general? I wouldn't mind having at least Bing tbh

SOI7 avatar Feb 15 '22 12:02 SOI7

It appears that the WebView which is embedded in Search is configured to disallow loading web pages from local network even when checknetisolation is configured, while it is needed to run a local web server which will add CORS header to Google's responses, because it will not load otherwise. I have an idea of implementing a proxy server instead of the web server and proxy only Search App requests through it with NDIS, but it is a more complex solution.

Does this affect only Google, or web engines in general? I wouldn't mind having at least Bing tbh

IIRC Bing loads correctly

krlvm avatar Feb 15 '22 13:02 krlvm

IIRC Bing loads correctly

Would you consider enabling Bing search in the main release if that portion is ready while you are working on other custom search engines? The beta release is a bit outdated at this point.

NicholasBottone avatar Apr 01 '22 14:04 NicholasBottone

IIRC Bing loads correctly

Would you consider enabling Bing search in the main release if that portion is ready while you are working on other custom search engines? The beta release is a bit outdated at this point.

Unfortunately, looks like this is no longer possible starting with build 1904X.1618+

krlvm avatar Apr 01 '22 15:04 krlvm

IIRC Bing loads correctly

Would you consider enabling Bing search in the main release if that portion is ready while you are working on other custom search engines? The beta release is a bit outdated at this point.

Unfortunately, looks like this is no longer possible starting with build 1904X.1618+

I guess because of the new Search Highlights feature

SOI7 avatar Apr 01 '22 16:04 SOI7

IIRC Bing loads correctly

Would you consider enabling Bing search in the main release if that portion is ready while you are working on other custom search engines? The beta release is a bit outdated at this point.

Unfortunately, looks like this is no longer possible starting with build 1904X.1618+

I guess because of the new Search Highlights feature

Actually, the native Bing search could be re-enabled in older versions by editing the code of the bundle's JavaScript files, but this no longer works - for some reason, network requests don't pass. Maybe this can be solved after more thorough inspection of the scripts, but they were written in React, which makes it difficult to read without source mappings.

krlvm avatar Apr 01 '22 17:04 krlvm

Neato, I was recommended this repo by github. I have a solution currently that hooks into MS Edge instead of the Start Menu but I'd love to direct traffic your way if you get this working within the Start Menu itself.

rcmaehl avatar May 17 '22 16:05 rcmaehl

Neato, I was recommended this repo by github. I have a solution currently that hooks into MS Edge instead of the Start Menu but I'd love to direct traffic your way if you get this working within the Start Menu itself.

This is unlikely to help - the Search Window still uses the deprecated EdgeHTML WebView, including on the latest Insider builds of Windows 11.

The Search Application simply adds an iframe to the document that loads a mini version of Bing search, the main feature of which is the allow CORS header when sending special data in the request.

The address of the WebView itself cannot be changed, and attempts to load the iframe from Google have failed due to CORS. The only thing that can be loaded there is a special version of Google search for iframe embedding, which allows CORS, but it does not fit into this small panel, because without setting cookies or changing the User-Agent, the mobile version cannot be loaded. Other search engines, again, due to CORS, cannot be embedded in an iframe.

A good solution would be to raise a local web server that proxies requests and modifies CORS headers, but it also does not load in the iframe, because firstly, UWP security rules block WebView access to local addresses until you explicitly allow this through PowerShell (this possible to do), and secondly, the WebView itself refuses to load local addresses or addresses on the local network until the appropriate prohibition is disabled in the WebView settings in the XAML or the UI Search App code.

Changing the hosts is also useless, since all these addresses resolve to 127.0.0.1 anyway, but it would be possible to perform a trick using a proxy server that would combine a CORS proxy when requesting a specific address, which is inconvenient, since it will force you to proxy in general, all traffic, or it could be done by writing a driver for the Windows Filtering Platform or using WinDivert, which is too unreasonably tricky for this.

Maybe in a future version I'll just add a web search button to the list of results, but here is also a problem - due to CORS, I can't get the query completion list from search engines, which again loses to the standard Bing Search.

It is also important to note that when search in Bing is enabled, that is, not disabled in the registry, all your even unfinished search queries come to Microsoft on the Bing servers in conjunction with your Microsoft account, even if you are looking for some local file and in general don't want to search the web, regardless of your privacy settings.

krlvm avatar May 17 '22 19:05 krlvm

Have you considered registering a URI and having the javascript call that URI for web search? This would allow you to access local addresses as the application registered for that URI will be handling the request, not UWP.

rcmaehl avatar Jul 05 '22 14:07 rcmaehl

Have you considered registering a URI and having the javascript call that URI for web search? This would allow you to access local addresses as the application registered for that URI will be handling the request, not UWP.

The Search App internal API accessible from JavaScript part provide a way to launch any executable file or URL, so it is possible to launch the default browser (not Microsoft Edge) without problems:

bsController.launchUri('https://github.com/');

There's also a very simple way of getting the search box input, but there's a problem which is not too simple to solve: we need to to inject a button to the search results - it should execute the code above, but it is pretty complicated to do since the Search UI is written with React.

krlvm avatar Jul 05 '22 14:07 krlvm

I Have Experience With React And Would Love to contribute to this project!

TechLionDev avatar Mar 01 '23 23:03 TechLionDev

well i do believe the project is open to PRs, despite the lack of a contributing.md file.

Poopooracoocoo avatar Mar 02 '23 06:03 Poopooracoocoo

updates?

XPower7125 avatar Apr 14 '23 13:04 XPower7125