ssborbis / ContextSearch-web-ext

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

Is there a way to add the search engin from https://parse.bqrdh.com/smart #512

Closed runningcheese closed 2 years ago

runningcheese commented 2 years ago

i DID a lot of research in "Issues".

but it just not happening, could you please help me up, thanks in advance.

ssborbis commented 2 years ago

I have no idea what that pages is supposed to do. I can't read it. You can try dispatching the change event.


document.querySelector('input').value = searchTerms;
document.querySelector('input').dispatchEvent(new Event('change'));
document.querySelector('.ant-input-search-button').click();
7peanuts commented 2 years ago

I modified it slightly, maybe the code is a bit bloated :joy:

(async() => {
  let input = document.querySelector('.ant-input.ant-input-lg');
  input.focus();
  input.value = searchTerms;
  input.dispatchEvent(new Event("input"));
  input.dispatchEvent(new Event("change"));
  await new Promise(r => setTimeout(r, 200));
  document.querySelector('.ant-input-search-button').click();
})();

不过我随便找了一个视频试了下,没有去掉 logo

ssborbis commented 2 years ago

Is it working?

runningcheese commented 2 years ago

yeah, it's working! thanks @ssborbis @7peanuts

runningcheese commented 2 years ago

@ssborbis Sorry to bother you again.What about this site? https://html2pdf.app i have try the code below, but not working correctly.

(async() => { let input = document.querySelector('.form-control'); input.focus(); input.value = searchTerms; input.dispatchEvent(new Event("input")); input.dispatchEvent(new Event("change")); await new Promise(r => setTimeout(r, 200)); document.querySelector('.btn.btn-primary.m-t-24').click(); })();

ssborbis commented 2 years ago

I'm getting good results with just this. I need to click the prompt to save or download, but it's working fine in FF

(async() => {
let input = document.querySelector('.form-control');
input.focus();
input.value = "http://example.com";
document.querySelector('.btn.btn-primary.m-t-24').click();
})();

What browser are you on?

runningcheese commented 2 years ago

What browser are you on?

Firefox, firefox is my favorite browser.

runningcheese commented 2 years ago

@ssborbis

(async() => { let input = document.querySelector('.form-control'); input.focus(); input.value = "http://example.com"; document.querySelector('.btn.btn-primary.m-t-24').click(); })();

i have just try this code in chrome, but it seems not working either.