Code Monkey home page Code Monkey logo

selecton-extension's Introduction

Selecton — text selection actions

Chrome Web Store Chrome Web Store Mozilla Add-on Chrome Web Store

Get customizable pop-up with action buttons on text selection!

  • Copy or search any text in one click - especially useful for laptops
  • Customizable appearance for tooltip and custom text selection color
  • Currency converter (supports 30+ currencies & 10+ crypto currencies)
  • Basic units converter (metric/imperial) and timezones conversion
  • Contextual buttons depending on selected text, such as 'Open link', 'Translate', 'Show on map', CSS color preview and more
  • Smart selection - automatic snapping of text selection by words, so you'll never lose that last letter again
  • Selection handles, which allow to quickly edit text selection
  • Live translation of the selected text on hovering the "Translate" button
  • Dictionary button, which fetches definition from Wikipedia on hover
  • Highlighter button, which allows to highlight specific text on page and quickly find it later

Download for Chrome: https://chrome.google.com/webstore/detail/selection-actions/pemdbnndbdpbelmfcddaihdihdfmnadi

Download for Firefox: https://addons.mozilla.org/firefox/addon/selection-actions/


Currency converter

Note: In order to make extension more autonomous, currency rates are set to be updated every 2 weeks, and at the moment of conversion data may not be 100% accurate. Currency conversion output is intended to be used only for a quick estimation. You can decrease update interval in extension's settings if needed, but minimal value for now is 7 days to not cause too much load on API servers.

AUD — Australian Dollar
BGN — Bulgarian Lev
BRL — Brazilian real
CAD — Canadian Dollar
CHF — Swiss Franc
CNY — Chinese Yuan
CRC — Costa Rican Colon 
CZK — Czech Koruna
DKK — Danish Krone 
EUR — Euro
GBP — British Pound 
HKD — Hong Kong dollar
ILS — Israeli New Sheqel
INR — Indian Rupee
IRR — Iranian Rial
JPY — Japanese Yen
KPW — North Korean Won
KRW — South Korean Won
KZT — Kazakhstani Tenge
MNT — Mongolian Tugrik 
MXN — Mexican Peso
NGN — Nigerian Naira
NOK — Norwegian krone
PLN — Polish złoty
RUB — Russian Ruble
SAR — Saudi Riyal
SEK — Swedish Krona
TRY — Turkish Lira 
UAH — Ukrainian Hryvnia
USD — United States Dollar
VND — Vietnamese Dong
ZAR — Rand

Crypto:
BTC — Bitcoin
ETH — Etherium
LTC — Litecoin
ADA — Cardano
BCH — Bitcoin Cash
XRP — Ripple
ZEC — Zcash
XMR — Monero
ZCL — ZClassic
DOGE — Dogecoin
IOTA (MIOTA)
EOS

Currency rates are fetched from fawazahmed0's currency-api


FAQ

How to disable word snapping?

  • Hold CTRL key while selecting text or modify selection with drag handle - in both cases text selection will not be snapped by word. To permanently disable word snapping, add website to word-snapping blacklist or uncheck: "Settings > Text selection > Snap text selection by word"

How to enable tooltip for text fields?

  • "Selecton settings > Text fields > Use special panel for text fields" This is disabled by default because with this option on extension will use a little bit more resources by analyzing every mouse click

Disable selection handles on the right and left?

  • Settings > Text selection > Add selection drag handles

Enable selecting text in links, like in Opera or Vivaldi?

On Firefox, can't change colors or import settings from extension popup

  • This is common Firefox bug, progress on this can be monitored here. To change colors on Firefox, open settings in new tab by clicking button in top-right corner of the popup

Change fetch interval for currency rates?

  • "Settings > Conversion > Rates update interval" This is set to "18" by default, because rates tend to not change drastically so often, and it is better to reduce load on free service we're using for fetching new rates.

Why extension doesn't work on new tab page?

  • This is basic security limitation in most modern browsers. Browser extension could not execute it's scripts on new tab page (speed dial), as well as on service pages (chrome://, about:, etc.) and in extensions store.

Additional search buttons do not show on hovering Search button?

  • Icons for these buttons are fetched from Google. It is possible that you have Ad-blocker installed, which blocks all requests to Google services. In this case you would like to use vertical layout for custom search panel to get at least labels shown, or visit Settings > Custom search tooltip and set your own icon for each option. It may also be that current website blocks all external requests at all, which prevents Selecton from loading favicons.

How to add new search option

  • Let's use YouTube as an example. Go on a website and search for something, like "gold" – your URL will look something like this: https://www.youtube.com/results?search_query=gold. You have to grab this url, replace gold with %s (placeholder for the searched text), and use it as url for the new search option (Extension options > Custom search options > Add new search option).

How to add Selecton settings as Vivaldi side panel?

  • Use this URL: chrome-extension://{ID OF EXTENSION}/options/options.html, where {ID OF EXTENSION} is a unique extension ID on your computer. You can get this from extension details page on chrome://extensions

Highlight button cuts the text selection

  • To make this tool work reliably, please highlight only single words or sentences. Highlighter trims text selection within one HTML node – otherwise page layout may be broken when highlight gets restored after page reload.

Selecton popup doesn't look right on some websites

  • You can try to tick "Apply configs immediately" setting in the extension options to improve compatibility. It will ensure that Selecton loads all settings and styles every time the selection popup is shown (instead of loading them only once on initial load), but it might also increase the effect on performance.

Contributing

You can make Selecton better without even knowing how to code:

  • Provide translation for your language: Base English file
  • Add your currency to the list of supported currencies: Currencies list
  • Selecton relies on looking for keywords in the selected text. Enhance them with keywords for your language: Keywords

Make your changes, and then create pull request here on GitHub so I can merge it. Also, you can always write me an email to share your ideas and suggestions.

Ideas for future releases

  • Advanced buttons editor, which allows to quickly turn on/off buttons and change their order with drag'n'drop
  • Cloud sync of settings using browser account sync
  • Ability to turn on/off background blur for tooltip and hover panels

Donate

If you really enjoy this product, you may also consider making a small donation for a coffee :)


Links to my other browser extensions

  • Circle Mouse Gestures – better mouse gestures, with visual representation of all available actions
  • Google Tweaks – set of tweaks for Google search page to make it easier to use

selecton-extension's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

selecton-extension's Issues

Frustrating Discord bug... (With Screenshot)

Hello there. First of all, thank you so much for developing such a useful and feature-rich extension, it's truly wonderful. Although, I sincerely hope it hasn't been abandoned.

A few minutes after I installed the extension for the first time, I opened my discord (web version), and a frustrating little bug presented itself after selecting a few words to copy:

2023-06-13

As you can see, for some reason the borders separating the options are gone and the text gets smushed together into one big word. Additionally, other things seem to be broken on Discord as well: I have Google and DuckDuckGo both set as search methods, yet when I hover over the 'search' option, neither shows up. I also have the "Remove text selection after selected action" set to true and that doesn't work either. When I click copy, for example, the selected text stays selected and the popup menu doesn't disappear.
The extension so far seems to be working perfectly on every other website I've visited. So hopefully this is a simple issue that can be easily fixed!

Thank you so much!

(Ps: One other nitpick if that's ok: When I select a word or a sentence in a text field and I delete it/replace it, the popup menu stays visible until I click somewhere else. Would it be possible to have it disappear the moment I delete/replace a selection?)

Sometimes doesn't respond to middle click in popup

Arch Linux
Google Chrome 96.0.4664.110
Selecton v3.4.1

I think this bug will be difficult to debug because it only happens sometimes.
Sometimes when I select text and want to open several searches in new background tabs with middle-click, it doesn't work. It simply hides the popup without doing anything.
However, if I minimize and immediately restore the Google Chrome window, it works again.

Tooltip Horizontal Alignment Issue

Selecting "No effect" as Tooltip Reveal effect in the settings causes a mis-alignment issue on tooltip. If you select another option other than the "No effect", everything works fine.
Picture1

It's not working in Google Search (google.com)

I really want to ditch Opera's own "Search pop-up" feature in favor of Selecton but your extensions doesn't seem to work on some websites, Google Search (google.com) being one of them. There's no pop up if I select the text.

Is this a feature or a bug?

Import Settings

I am able to export Settings but when I tried to import them the Settings menu dropdown just closes but nothing is imported.

SOLVED: Opened extensions page and then options for this extension and import works fine that way but NOT using the Extensions button in the toolbar.

Version 3.6.7 Issues

Selecton upgraded to Version 3.6.7 today and now the "copy" option doesn't work and the selection pop-up won't go away when you click elsewhere on the page. I haven't tested out all the other features, but some are definitely working as normal.

  • Vivaldi: 5.5.2805.38 (Stable channel) (64-bit)
  • OS: Windows 11

Please let me know what other information you need.

Suggestion/Request

I'm not having an actual problem, but it is sort of an issue.

The dictionary function almost always fails to produce a definition. Any chance that you can use dictionary.com or some other reference to check for definitions? You use Wikipedia currently it seems, hopefully there is a better option that works more often you can implement.

Thank you, this is one of the best extensions in terms of usefulness and I'm glad to have stumbled across it on reddit when you first released it.

CTRL Hotkey to Trigger Panel Re-open

Sometimes I highlight something and then the pop-up goes away because I accidentally press a key (or for some other reason).

Currently there doesn't seem to be a a way to easily retrigger the pop-up. Can we make it so that if the panel isn't selected we can double-press CTRL to re-trigger it? Hopefully this wouldn't interfere with the existing feature to hold CTRL as we highlight to disable word-snapping.

It doesn't work in text box

Vivaldi v4.3.2439.65 (Stable channel) stable (64 bits)
Selecton v3.4.0

When I select text in a text box (for example here), the popup is not showed.

Make drag handles work properly after scroll

Desired behavior:

  • Select big multi-line text -> drag handles appear on the screen
  • Scroll page, so that upper drag handle goes off-screen
  • Extend selection by dragging bottom drag handle

Current behavior:

  • Text selection is getting clipped by screen edge on top

Piece of code related to this issue:

/// TODO: It seems that when scrolling page, startY and endY are bounded to visible screen

Any idea if the extension could work for PDFs and iframes?

Hi, thanks for a great extension!

I was wondering if someone knows if it is possible (or maybe impossible) that this extension could work with:

  • The browsers internal PDF viewer (eg. for Chromium and Firefox). Not sure if access to the text-selection is currently technically possible. If not, I think submitting an issue for this to the browser repo's might be worth a try.

  • Self-hosted iframes (same-domain, etc). Looking here, this would seem to be the case for all iframes (not just local ones), when "all_frames": true is set in the manifest.json file.

I actually would love to be able to use this extension in these situations.

Triple clicking URL text does not open the go to link option

Sometimes I see links on some websites that are not clickable, meaning only the text is there like this.

github.com/emvaized/selecton-extension

When I triple click it, all the text gets selected but Selecton does not show the option to go to that link.
However, if I manually click and drag to select the URL text, Selecton shows the go to that link option.
Would be great if it also worked when you triple clicked on the URL text. Also, notice if the www. isn't there in the beginning, it doesn't work. Not really a huge issue but I thought I'd mention it anyway.

Currency conversion is not working correctly for TRY

This feature used to work fine, but since the last updates it has been converting incorrectly. It might be due to API you are using exchangerate.host.

I also noticed that you have changed the minimum rate update interval (days) to 3 but mine was still 1 (the value before the change was applied). I changed it to 3 days but nothing changed. It might be also related to that.

[Firefox] Color picker closes addressbar popup

Extension currently uses the same html for settings page and addressbar popup.
While being open as a popup, calling color picker to change any of the colors (for example, tooltip background color) automatically closes the popup, and therefore chosen value is not getting saved.

Issue occurs in Firefox 87.0

shortcut keys to do task quickly

Could you add "shortcut keys" as well like for "Highlight" option and "copy page link to the selected text" option. it would be Amazing Thanks for this wonderful extension

'&' character in search terms breaks search results

Performing a search on a text containing '&' character shows the results only for the part before the &. For example if you try searching for "Asterix & Obelix" it shows only the results for "Asterix". The character should be probably replaced with %26.

Adding Norwegian Currency

Hey there! Loving the add-on and amazed at the speed you're developing it at.

Was wondering if it was possible to add Norwegian currency? NOK, the Norwegian Krone. You have both Swedish and Danish (currently using the Swedish one as an estimate) and feel it would be nice to have all three crowns.

Changing options does not affect the extension

Hi,

since the latest updates, changing options does not affect the extension in any way. I have turned off the translation button, but it is still there. I have changed the search engine, but it still uses Google, etc.

Any idea what can cause that?

Feature Request

Hi, I am not a programmer; I tried to edit code to open in background tab but failed.

Please make a option to open in background tab ( middle click is not suitable for me)
and minor suggestion

instead of paste clipboard item on text field, in windows, windowskey+v ( clipboard history window) to choose older clipboard item

Thanks for good utility.

Unit and time conversion issues

Hey there! This is a great add-on, good job with that.

Only drawback I've experienced with is unit and time conversions. Currency conversions seems working fine. I used the site given below for testing different units and time zones and most of them failed.

Test site: https://blogs.opera.com/desktop/2017/08/time-zone-unit-converters-highlight-opera-48-beta-release/

Also working time conversions displays results in 12Hour format and sometimes with colon(":") sign at the end of it. It is a bit confusing. Can you represent them in 24 Hour format or add am/pm indicator?

Thank you for the hard work.

Screenshot 2021-11-03 145054

Wrong time conversion

10 AM EST is converted to 18:00, but should be 17:00 (advancing to EDT). Current time zone is GMT+3.

Does not replace the "%s" with the search term

Google Chrome 108.0.5359.124
Selecton 3.6.9

Maybe the problem is with the latest Google Chrome update because until yesterday it was working fine for me.
I select a text, press any of the buttons I have for search, the search page opens but with the text to search empty.

For example, I have this search button https://www.imdb.com/find?q=%s&s=tt&ref_=nv_sr_sm but it opens https://www.imdb.com/find?q=&s=tt&ref_=nv_sr_sm

Debug mode enabled by default

debugMode should equal to false in public releases due to countless amount of debug messages in console which are useless for average user and unbearably interferes for another JS developers while debugging

var debugMode = true;

I also propose you to replace such constructions:

if (debugMode) {
  console.log('Detected selection tooltip on the website with following style:');
  console.log(elementStyle);
}

with

if (debugMode) {
  console.log('Detected selection tooltip on the website with following style:', elementStyle);
}

Thus you will reduce amount of debug messages without loss of their quality

Wrong number of icons in row

Google Chrome 98.0.4758.80
Selecton 3.5.1

I have set 5 icons per row in settings:

2022-02-12_09-42_1

But in the first row it always puts one more.

2022-02-12_09-42

Export/import settings didn't work

Hi. First of all, I just want to say this is an excellent extension. The best I've found so far for copying and searching selected text quickly. Unfortunately, it doesn't have a lot of downloads or reviews yet. I hope that will change soon. Maybe it needs some marketing.

Anyway, I just want to report an issue I faced.

Initially, I installed this extension directly from the files on this GitHub page. Then, I tweaked the extension settings based on my liking. Later, I found the extension on Google Chrome store. So, I exported the extension settings to a .json file and then installed the Chrome store version. But when I tried to import the settings, the Import button was grayed out and it couldn't import the settings from the .json file. So, I had to tweak the settings all over again manually. I think the Export/import settings has a bug. Please, look into it. Thank you.

Unable to Sort Search Buttons, They Revert to Random

Hello;

So far, really digging the add-on. I just have one issue. I have tried to manually change the order of the Search Buttons after entering those I typically like to have handy. I have exactly 20 search buttons.

I manually reordered them by subject and then alphabetically, e.g., search engines first, then online shopping sites, then various sites of different uses.

When I tested the add-on using the “Test the Settings” button at the bottom of the preferences page, I saw that the search buttons were still in the original random order when the drop-down menu appeared and hadn't changed at all. I tried this on different websites as well, with the same result.

I then reloaded the Preferences page for Selection, and all the changes I had made to re-order the Selection Buttons vanished and were replaced with the random original order. It was a rather tedious process to use the little arrows up and down to get the Selection Buttons in the order I wanted.

If this can be figured out, or if there is needed information that might help, please let me know. Also, not being technically oriented, I may need a little instruction on how to access whatever information you need.

One other thing occurred to me as I was re-ordering the Selection Buttons. Would it be possible to incorporate a numbering system as well along with the arrows so that instead of the arrows, we could just renumber their order by simply typing the order they should be in. For example, (1) Amazon, (2) Bing, (3) Google, etc.

Thanks so much.

2Data6

System Information

Firefox 111.0 (64 – Bit)
Mac (21.5-inch, Late 2012)
Processor 2.7 GHz Quad-core Intel Core i5
Memory 8 GB 1600 MHz DDR3
Startup Disk – External Samsung SSD
Graphics NVIDIA GeForce GT 640M to 512 MB

Custom search engines can't get it to work and don't know how

First of all, I LOVE this adon and in my opinion it is the most rich-full of options and customization. Because I'm a noob I do not know what to put after ".com" for search engines. Please tell/explain me how that works. I noticed that the other ones have something at the end.
Thank you and have a nice day!!!

16 01 2023  20-38-08

Can add a category display?

When using "Use vertical tooltip layout (experimental)", can the order inside be in the same direction, don't go up at one time and down at another time, it's so confusing.
image
image

Like the has been removed Context Search I used before, it can distinguish between search, dictionary, and translation.
2023-01-27_185513

Check the link with "Show on search button hover" to display the open link. Using "Show in main panel" will not show options for open link.
image
image

In addition, please add the currency of New Taiwan Dollar. Thank you.
image

Allow searching with multiple search engines at the same time

In my case I sometimes need to search for the same word/phrase in several search engines. It would be very convenient to be able to do it in one go instead of having to select the text, press search, go back to the page, select again and press search again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.