Closed dsanalytics closed 3 years ago
Can you use this format instead?
${title}${enter}${url}${enter}Excerpt:${text}
This format can only be used from the text selection context menu. If you use it from any other operation, ${text}
will not perform the desired action.
In order to use it from other operations, you need to use the content script, but this extension does not have the permission of the content script, so it cannot be used at present. (Reference: #17)
(By analogy with ${marked}=window.getSelection().toString();
)
Thanks for the idea.
It does not work from the context menu on the page. I marked one text sentence on www.amazon.com, selected format from the page context menu and got Excerpt:${text} - i.e. it did not pick it up. No errors. Please advise.
https://www.amazon.com/
That's all. I apologize for the lack of words.
Example: (select "You are on amazon.com.") Amazon.com. Spend less. Smile more. https://www.amazon.com/ Excerpt:You are on amazon.com.
OK, that works but there's new problem: If no text is selected then ${text} picks up the page title, i.e. same as ${title}. Shouldn't it be just blank?
Also, why is ${text} working only in the context menu, i.e. when text is marked, and not from the toolbar menu when marked text is ignored and title is used? I use toolbar menu almost always, because it saves me from having to travel/navigate with my mouse pointer to the menu/sub-menu that is not in the same place as with toolbar menu.
Also, keyboard shortcut is not picking marked text but the title, which is unfortunate.
See what you can do - thanks for your help and time.
The reason ${text}
copies the page title is that it is intended to be used in the following way.
[${text}](${url})
If there is a text selection, use the text selection. If there is no text selection, use the page title. The method of using only selected text has not been considered until now.
The following format may solve the problem. (Reference: #41)
${selectedText}: selected text or blank text( or "undefined"). (unimplemented)
However, this will only work in the text selection context menu. Outside of the text selection context menu, it will not perform the desired action.
Copying selected text will not work from the toolbar menu. This is a limitation due to the API that WebExtensions provides to extension developers. In order to break through this limitation, the use of content scripts is required. However, this extension does not have the permission to use content scripts, so it is not possible to use selective text from the toolbar menu. (Reference: #17)
I understand that you want to copy the selected text from the toolbar menu or keyboard shortcut. But right now, this extension cannot provide that functionality yet. This is because it is not possible to provide the desired functionality without using content scripts. So, I recommend you to use a similar extension that uses content scripts.
Thanks for this great extension! One thing I'd love to have there is the ability to access marked text on the page, through an extra new keyword e.g. ${marked}. That way, format command could also specify to copy marked text from the page as plain text into the clipboard. That'd be very convenient - no extra mark, copy, and paste needed!
Format example: ${title}${enter}${url}${enter}Excerpt:${marked}
Thanks in advance.