emvaized / selecton-extension

Selecton browser extension provides popup with actions on text selection in Chrome and Firefox
Other
77 stars 17 forks source link

Add an option to have multiple search engines in the menu #5

Closed sbstn87 closed 3 years ago

sbstn87 commented 3 years ago

Hi, could you add an option to have multiple search engines available? It would be something like this: https://addons.mozilla.org/en-US/firefox/addon/contextsearch-web-ext/

I sometimes search for a selected text not only in DDG, but on Amazon, YT, etc.

emvaized commented 3 years ago

This one is already implemented :) Extension settings -> Custom search tooltip, here you could enable this feature and configure shown buttons custom-search-demonstration

sbstn87 commented 3 years ago

OK, so it simply does not work for me. I have this option enabled, but nothing happens when I hover over the "Search" item in the menu.

Is there any way to submit a debug log or something?

emvaized commented 3 years ago

Yes, sure!

  1. Enable "debug mode" in extension settings
  2. Open any page
  3. Hit Ctrl+Shift+J to open developer's tools
  4. Select any text on page
  5. Grab the output of "Console" in developer's tools, or take a screenshot of it

At this moment it's the only way of getting relevant logs.

I would also suggest checking this feature on different websites (I usually test on stackoverflow.com) to exclude domain-specific factors, and trying to change search buttons order to see if it'll make any difference.

sbstn87 commented 3 years ago

OK, I did it and that's the result:

cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 Error: Could not establish connection. Receiving end does not exist. 2 background.js:315:37 sendRemoveListener on closed conduit {506e023c-7f2b-40a3-8066-bc5deb40aebe}.1924145348672 ConduitsChild.jsm:108 sendRemoveListener on closed conduit linkalert.conlan@addons.mozilla.com.1924145348631 ConduitsChild.jsm:108 sendRemoveListener on closed conduit {506e023c-7f2b-40a3-8066-bc5deb40aebe}.1924145348636 ConduitsChild.jsm:108 AbortError: Actor 'ExtensionContent' destroyed before query 'Execute' was resolved 3 ExtensionCommon.jsm:742 Error: Invalid window ID: -1 undefined cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 sendRemoveListener on closed conduit {506e023c-7f2b-40a3-8066-bc5deb40aebe}.687194768204 ConduitsChild.jsm:108 sendRemoveListener on closed conduit linkalert.conlan@addons.mozilla.com.687194768209 ConduitsChild.jsm:108 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 sendRemoveListener on closed conduit {506e023c-7f2b-40a3-8066-bc5deb40aebe}.687194768252 ConduitsChild.jsm:108 sendRemoveListener on closed conduit {506e023c-7f2b-40a3-8066-bc5deb40aebe}.687194768262 ConduitsChild.jsm:108 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 Error: Invalid window ID: -1 undefined Error: Could not establish connection. Receiving end does not exist. background.js:315:37 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 Error: Invalid window ID: -1 undefined cookies is undefined trackmenot.js:738 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. trackmenot.js:732 Error: Invalid window ID: -1 undefined cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270

emvaized commented 3 years ago

It looks like you don't have 'debug mode' option enabled in extension settings

sbstn87 commented 3 years ago

Weird, it has been enabled. Once again a debug log from a different site:

sendRemoveListener on closed conduit {506e023c-7f2b-40a3-8066-bc5deb40aebe}.549755815882 ConduitsChild.jsm:108 sendRemoveListener on closed conduit linkalert.conlan@addons.mozilla.com.549755815892 ConduitsChild.jsm:108 Promise resolved after context unloaded 2 prefs.js:25 can't access dead object IndexedDB.jsm:101 Promise rejected after context unloaded: An unexpected error occurred prefs.js:25 Error: Invalid window ID: -1 undefined sendRemoveListener on closed conduit {506e023c-7f2b-40a3-8066-bc5deb40aebe}.549755815950 ConduitsChild.jsm:108 sendRemoveListener on closed conduit linkalert.conlan@addons.mozilla.com.549755815960 ConduitsChild.jsm:108 Error: Invalid window ID: -1 undefined Error: Could not establish connection. Receiving end does not exist. background.js:315:37 Error: Could not establish connection. Receiving end does not exist. background.js:327:37 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 sendRemoveListener on closed conduit {506e023c-7f2b-40a3-8066-bc5deb40aebe}.687194768299 ConduitsChild.jsm:108 sendRemoveListener on closed conduit linkalert.conlan@addons.mozilla.com.687194768304 ConduitsChild.jsm:108 sendRemoveListener on closed conduit {506e023c-7f2b-40a3-8066-bc5deb40aebe}.687194768356 ConduitsChild.jsm:108 sendRemoveListener on closed conduit {506e023c-7f2b-40a3-8066-bc5deb40aebe}.687194768366 ConduitsChild.jsm:108 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 cookies is undefined background.js:1271 Unchecked lastError value: Error: First-Party Isolation is enabled, but the required 'firstPartyDomain' attribute was not set. background.js:1270 Error: Invalid window ID: -1 undefined Error: Could not establish connection. Receiving end does not exist. background.js:315:37 Error: Could not establish connection. Receiving end does not exist. background.js:315:37 Error: Could not establish connection. Receiving end does not exist. background.js:315:37 Error: Invalid window ID: -1 undefined Error: Could not establish connection. Receiving end does not exist. background.js:315:37 Error: Invalid window ID: -1 undefined

emvaized commented 3 years ago

Here's how it should look here on github when debug mode is enabled: image

sbstn87 commented 3 years ago

So perhaps there's something else that prevents debug mode to be enabled for me, that also prevents the additional search engines to be displayed. At the moment I have no clue, what could be the reason.

emvaized commented 3 years ago

Hmm, I can't even think of situation when debug messages fail while the main tooltip works fine.

Maybe extension fails to load settings from memory? Are you able to change some other settings, and see if it makes any effect? Also, what browser do you use, and do you have any other extensions installed which may add their own page listeners?

sbstn87 commented 3 years ago

I tried some other options and everything seems to work: conversion, translation button, changing tooltip's style and pop up behaviour.

I also tried to disable first party isolation and resist fingerprinting but it does not help.

sbstn87 commented 3 years ago

I got the underlying reason. Somehow uBlock Origin blocks the extension from displaying additional search engines. When uBO is disabled, it works perfectly fine.

sbstn87 commented 3 years ago

Some additional details: uBO blocks custom search engines, only if the Google domain is blocked by it. I use uBO in medium mode, so by default Google is blocked everywhere, but Google's domain, so the extension works for me on YT website for example.

emvaized commented 3 years ago

Thanks a lot for details! Yeah, issue seems pretty clear now. Selecton uses Google services by default to get favicons for each custom search engine, in the following manner: https://www.google.com/s2/favicons?domain=aliexpress.com And since uBO blocks all Google-related requests on your end, extension failed to show panel with all these buttons.

For now I suggest to try setting custom icons for each search engine enabled - this way panel should work everywhere. And I would think of a workaround for this in the next updates

sbstn87 commented 3 years ago

Great to know. I'll be waiting for the new version that works that around. Thanks!

emvaized commented 3 years ago

In new version 3.0.4 I've set default icon urls for all pre-added custom search engines, and also redesigned settings to make 'Use icon from Google' behavior type more explicit.