Open EliCodesForFun opened 4 years ago
I think it's a good idea. There's a collective issue for similar feature requests here: https://github.com/FooSoft/yomichan/issues/267
This could probably be done completely without mouse in caret browsing mode (works on Firefox with F7) together with https://github.com/FooSoft/yomichan/issues/161 using oncopy
event together with document.execCommand('copy')
.
POC code:
window.addEventListener('copy', (e) => {
const selection = document.getSelection();
console.log(e, selection);
});
// (enter caret browsing mode and move the caret to some position)
document.execCommand('copy'); // gives target element, exact caret position and such
I have a POC branch for this feature. The first obvious issue I noticed was with focus on the popup, but that could probably be easily solved using postMessage
. document.js
could also need some updates, but I don't want to have conflicts with https://github.com/FooSoft/yomichan/pull/286.
This feature should also be added on the search page to work with the sentence parser.
I was wondering if it'd be possible to add in a setting/option where you can press the left or right arrow to scroll through the words (or characters) in a sentence, after mousing over the first word. I think this would be good for people trying to read thing while using a controller. Basically you could just mouse over the first word, then press the arrow keys to kind of read along. I think it could be pretty cool. Any thoughts?