Open dnknn opened 2 years ago
update edited :)
There's a hidden option in the release I just dropped ( 1.38 ) called multilinesAsSeparateSearches
. If you enable that, it will treat multi-lines as separate search terms. Right now, it only works from the context menu, but it's there. I'll get something more robust when I have time.
Actually, I don't think that change made it to the new release. It is in the repo, however.
@ssborbis Hi, add sub-options of this advanced option, Do you think it is necessary?
Of course, don't worry, just let you know. :)
☑ And enable sequential delay
(tooltip: Prevent access denied when opening multiple pages at once.)
maximum number of lines
(tooltip: To avoid misoperation and open dozens of hundreds of tabs at the same time, When getSelection() exceeds the set maximum number of rows, this function is not executed, but a prompt is displayed.)
For example: userOptions.splitMultilineAmount
<input type="number" min="5" max="50" step="1" id="splitMultilineAmount">
if ( searchTerms.split('\n').length > userOptions.splitMultilineAmount ) {
alert(`Exceeds the set number of lines !`);
return;
}
Hi @ssborbis
There's a hidden option in the release I just dropped ( 1.38 ) called
multilinesAsSeparateSearches
. If you enable that, it will treat multi-lines as separate search terms. Right now, it only works from the context menu, but it's there. I'll get something more robust when I have time.
Since there is no UI option, I manually enable it in the Console
userOptions.multilinesAsSeparateSearches = true
defaultUserOptions.multilinesAsSeparateSearches = true
Then I tested and found that the function does not work 😭-_-😢
Also, would like to ask when will this feature be added to the UI options?
It won't work in the release ( 1.38 ). It should be working from the code in the development repo, however.
I'll post a beta you can test.
Since there is no UI option, I manually enable it in the Console
You can do that or manually edit the preferences JSON from here.
@ssborbis Version V1.39(CWS version) still doesn't work -_-
I use the Chrome browser and installed the latest version V1.39 on the CWS store.
then manually edit the preferences JSON, Save, but still doesn't work...
Whether it's the context menu or other search methods, multilinesAsSeparateSearches
still doesn't work, -_- I don't know why.
Do you have an example webpage where it's not working? I've been using a simple test page and I've tested in textarea fields and with <br>
tags as newlines and it is working in chromium.
I did notice the "Cancel" button isn't working if you get prompted for being over the limit. I have that fixed in the repo.
Do you have an example webpage where it's not working?
🤝ThankS! Now it works! the principle needs to restart the browser to work.
@ssborbis Now I also found another problem for the new version:
1) text selection getSelection()
2) Then start ContextSearch, the search box is automatically populated with getSelection()
, right?
3) ContextMenu and QuickMenu are fine. no problem
4) But the startup of these two places cannot be automatically filled in getSelection()
. Problem/Bug
In fact, this problem is similar to insensitivity. In most cases, it will not be automatically filled, or it needs to be restarted(click again) repeatedly to be automatically filled.
I don't know why, or what code you changed, the previous 1.28/1.29 versions were perfect, never had this problem.
Similar question I reported a long time ago: https://github.com/ssborbis/ContextSearch-web-ext/issues/361
Does this problem happen when multilinesAsSeparateSearches
= false ?
Does this problem happen when
multilinesAsSeparateSearches = false
?
exactly the same, has nothing to do with multilinesAsSeparateSearches
This may be related to the issue of editing the search bar in the qm is not updating the search terms in the actual search.
I have that fixed, and I tested the problem of selected text not populating the toolbar and sidebar menus when they are opened, and it seems to be working normally.
Updates are in the dev repo, if you're able to test.
I tested the problem of selected text not populating the toolbar and sidebar menus when they are opened, and it seems to be working normally.
Correction. It seems to be working only some of the time. I'll dig around and try to find why that is.
Ok, you can try what's in the dev repo to see if it works for you. For some reason I don't understand, chromium-based browsers require a slight delay in setting the search bar value to the search terms, as seen by getSelection()
. I'm currently using a 10ms delay, and seem to get the correct selected text in the search bar 10/10 times.
chromium-based browsers require a slight delay in setting the search bar value to the search terms, as seen by
getSelection()
. I'm currently using a 10ms delay, and seem to get the correct selected text in the search bar 10/10 times.
thanks for your hard working! I tested it and found it to be perfect, and I didn't find the problem of not filling or not updating the filling.
v1.41.1 is out. I'm not sure this fix made it into a release before now. Let me know if this is working correctly, or just close out the issue, and I'll assume it is.
How often are you using this feature? I wonder if it wouldn't be useful to make this standard behavior, but prompt with a yes/no confirmation dialog if the search terms are multiline.
Hi✿(◕‿◕)✿! Only an example can describe the feature :)
Current state : ContextSearch can easily implement a keyword to open multiple search engines, But a multi-line keyword cannot use a search engine to open the corresponding multi-line search.
Expected behavior of this feature :
getSelection()
select them all\n
). It may be possible technically, but the question is, how to realize it, and in what way to realize this function :) For example, advanced options add a UI switch :getSelection()
exceeds the set maximum number of rows, this function is not executed, but a prompt is displayed.)