ssborbis / ContextSearch-web-ext

Search engine manager for modern browsers
354 stars 37 forks source link

How to make a template for a website that doesn't have a searching URL #696

Open MW-J97 opened 7 months ago

MW-J97 commented 7 months ago

Let me explain more, please.

For example, this website https://www.braflix.video doesn't have a searching URL that's used for the template section in the engine like Google, Yandex and other websites.

When I search for something in this website, it gives me this URL, https://www.braflix.video/search. And when I get into any content in it, this is the URL I get, https://www.braflix.video/tv/6673. As you see, I don't get any part of the URL I can replace it with %s or {searchTerms}.

ssborbis commented 7 months ago

That website is detecting for web developer tool and redirecting me to google.com. If not for that, I'd think it would be a simple case of using some post-search scripting to run the search. I don't think you are required to have a %s or {searchTerms} in the template, but it may show an error. I'd set the template to https://www.braflix.video/search and use some javascript to submit a search on the website

ssborbis commented 7 months ago
{
let input = document.querySelector('#SearchInput');
input.value = searchTerms;
}

i don't know the event to trigger the search, but you can press the space key to see the results after opening the page. The search terms will be filled in. If you can get to the dev tools to see the events, you can find which to dispatch

MW-J97 commented 7 months ago

i don't know the event to trigger the search, but you can press the space key to see the results after opening the page.

This script works. It's a bit slow and as you said I need to press space to make it work. But, can't we add a space to the end of it? And will this space trigger the search?

Update: I notice another issue, this website has a check for robot option and that sometimes affect the search term and makes it empty.

MW-J97 commented 7 months ago
{
let input = document.querySelector('#SearchInput');
input.value = searchTerms;
}

This website has the same issue https://www.wcoforever.tv/search. I tried this syntax on it, but doesn't work.

ssborbis commented 7 months ago

i don't know the event to trigger the search, but you can press the space key to see the results after opening the page.

This script works. It's a bit slow and as you said I need to press space to make it work. But, can't we add a space to the end of it? And will this space trigger the search?

Update: I notice another issue, this website has a check for robot option and that sometimes affect the search term and makes it empty.

You may be able to find a filter for your ad blocker than can disable the robot checking.

ssborbis commented 7 months ago

This website has the same issue https://www.wcoforever.tv/search. I tried this syntax on it, but doesn't work.

I can add that website the normal way ( right click -> add to contextsearch )

image

MW-J97 commented 7 months ago

You may be able to find a filter for your ad blocker than can disable the robot checking.

I am using uBlock Origin and searched for a filter, but I don't think I can find one.

MW-J97 commented 7 months ago

This website has the same issue https://www.wcoforever.tv/search. I tried this syntax on it, but doesn't work.

I can add that website the normal way ( right click -> add to contextsearch )

Wait a minute!! I have been using this extension for almost 2 years or more and I have always been adding engines manually. And now I discover that I can add an engine automatically through the context menu with right-click on the search bar of the website?! 🙂 Oh boy, it hurts 😂

ssborbis commented 7 months ago

Wait a minute!! I have been using this extension for almost 2 years or more and I have always been adding engines manually.

I don't think you're alone in that. I really need to make an onboarding slideshow or something for basic features. There's an ancient video at the top of the Help tab in CS Options but I don't know how many users go there.

MW-J97 commented 7 months ago

I really need to make an onboarding slideshow or something for basic features.

Yes, exactly. I don't know if that'll be easy or not. But may be adding a guide page that open automatically on the first use or after new updates showing the main or new features will be good.