Comments (6)
Okay, I was able to pinpoint the issue. It's an infinite loop in common/modules/finder.jsm:491
. That is, in the highlight
function of the RangeFind
class. Link. When removing that loop the issue disappears entirely (though highlighting results also breaks).
I got to this by placing a breakpoint before and after the loop (after trying other spots at finder.jsm
). It reaches the first breakpoint, I press play, but it never reaches the second - Firefox becomes irresponsible and I have to kill it.
I am testing it on a more recent version of Firefox than I previously reported:
:version
Pentadactyl 1.2pre (created 2017/05/31 22:07:30) running on:
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Can any devs take a look at this?
from dactyl.
One simple way to work around this is to hide the input elements while the highlighting is done and restore them. I tested it (manually) and it works. (Obviously, the matches in the input fields are left out.)
If you restore the fields immediately after the highlighting, you do lose the wraparound behaviour of n/N however: to get back to the top match from the bottom, you have to reverse direction or repeat the search. If you leave the fields hidden, n/N wil work normally.
Note: once the fields are unhidden and the highlighting is cancelled, pressing n/N will freeze the browser, since it repeats the search highlighting with the input fields visible. (If you wanted, you could prevent this issue by never actually cancelling the search highlighting, but instead hiding it temporarily using a style.)
If you want to test it, you can use these commands from my .pentadactylrc:
command! hideselector -nargs=* -js hideSelectors.call(null, ...args);
command! unhideselector -nargs=* -js unhideSelectors.call(null, ...args);
js <<EOF
function hideSelectors(...sels) {
var doc = content.document;
sels.forEach(sel=>{
var elts = Array.from(doc.querySelectorAll(sel));
elts.forEach(e=>{
var css = e.getAttribute('style') || '';
e.setAttribute('style', css+" display: none !important;");
});
});
}
function unhideSelectors(...sels) {
var doc = content.document;
sels.forEach(sel=>{
var elts = Array.from(doc.querySelectorAll(sel));
elts.forEach(e=>{
var css = e.getAttribute('style') || '';
var hideregex = /(^|;| ) *display: *none *(!important)? *;/g;
e.setAttribute('style', css.replace(hideregex, ''));
});
});
}
EOF
I tried rebinding /, n and N to hide the input fields first, and using C-/ to clear the highlighting and unhide the input fields.
map <hide-inputs> -ex hideselector input
map <unhide-inputs> -ex unhideselector input
map / <hide-inputs><find-forward>
map n <hide-inputs><find-next>
map N <hide-inputs><find-previous>
map <C-/> -ex noh | unhideselector input
but it seemed a bit unreliable, so I've settled on just rebinding / and leaving the input fields hidden. If I need them again after searching, I have a binding specifically to restore them:
map <hide-inputs> -ex hideselector input
map <unhide-inputs> -ex unhideselector input
map / <hide-inputs><find-forward>
map <C-?> <unhide-inputs>
This can be implemented in a .pentadactylrc file. A better workaround would be to hack the source so the highlight function simply ignores matches in input fields. I haven't tried that yet, but it sounds simple enough.
from dactyl.
Any news here, if this can be fixed?
from dactyl.
As this issue is annoying I'm going to test your workaround. However I would appreciate a bugfix in the sources.
from dactyl.
This seems to work sometimes, but now always.
For instance: Search an IP address if some edit field is open.
How to reproduce:
- Sign in to Wikipedia and edit a wiki
- https://de.wikipedia.org/w/index.php?title=Private_IP-Adresse&action=edit
- Search for an IP Adress:
- /172.31.255.255
..freezing.
from dactyl.
This is still unstable, last freeze on https://forums.gentoo.org, writing a comment, preview, search by /, freeze. Which is most annoying as all the comment is lost...
from dactyl.
Related Issues (20)
- How to achieve Ctrl-t functionality
- Pentadactyl + JavaScript: getting value of an object? HOT 1
- Specify a folder for :bmark?
- buftabs broken in FF 50 ? HOT 2
- resource://dactyl-content/bookmarks.js: 376: TypeError: window.convertFromUnicode is not a function HOT 3
- Completely broken in FF 51
- resource://dactyl/template.jsm:178: Ary#iterValues is deprecated: Please use Array#values instead
- Favicon showing on the right side of the tab HOT 1
- Firefox 54: bootstrap: TypeError: /^function .*?\((.*?)\)/.exec(...) is null HOT 5
- Pentadactyl vs Waterfox HOT 2
- defsearch keeps getting reset to google? HOT 2
- inspector "Rules" panel is empty in FF52.2 HOT 1
- Pentadactyl does not work in Firefox 54.0.1 HOT 2
- Two hintkeys problems + a feature suggestion
- Firefox 55(.0.3) crashes with Pentadactyl installed. HOT 10
- qmarks vs. capturing a keypress (more of a Javascript question)
- "Invalid value for tags" when attempting to add a bookmark
- FF 57 support? HOT 1
- A great THANK YOU for the good times HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dactyl.