ContextSearch-web-ext icon indicating copy to clipboard operation
ContextSearch-web-ext copied to clipboard

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

Open MW-J97 opened this issue 10 months ago • 10 comments

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}.

MW-J97 avatar Apr 21 '24 14:04 MW-J97

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 avatar Apr 23 '24 06:04 ssborbis

{
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

ssborbis avatar Apr 23 '24 06:04 ssborbis

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 avatar Apr 23 '24 10:04 MW-J97

{
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.

MW-J97 avatar Apr 24 '24 08:04 MW-J97

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 avatar Apr 24 '24 16:04 ssborbis

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

ssborbis avatar Apr 24 '24 16:04 ssborbis

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 avatar Apr 24 '24 16:04 MW-J97

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 😂

MW-J97 avatar Apr 24 '24 16:04 MW-J97

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.

ssborbis avatar Apr 24 '24 18:04 ssborbis

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.

MW-J97 avatar Apr 24 '24 19:04 MW-J97