Open mehrdadn opened 6 years ago
Bump?
Thanks for the contribution, I've been heavily backed up on work, life and other projects. Sorry for the delay, I will try to address PRs in the future.
On Sat, Jan 13, 2018 at 1:07 AM mehrdadn notifications@github.com wrote:
Hi! This is an update to address the chromeIPass performance issue due to jQuery; it is intended to resolve issue #550 https://github.com/pfn/passifox/issues/550.
It is somewhat ad-hoc and not well-written, but I think it should (?) work correctly. The idea is to use Zepto.js as a lightweight alternative to jQuery where possible, and load jQuery dynamically when input fields are actually detected. This prevents most subframes from loading jQuery, since generally few subframes have input fields.
I mainly tried to minimize the diff and avoid impacting the old code where possible (to make it easier to compare/understand), so that's why the code isn't very polished. I can fix the indentation issues, etc. if desired; it was a bit difficult to do this non-invasively since I would have had to re-indent and re-touch existing code as well.
One thing to note is that I also replaced the setInterval call with MutationObserver. I'm not sure whether the observe() call needs attributes: true instead of attribute: false. Please change this if needed. (I didn't set it lest there is a performance impact.)
It would be great if someone could also test this and make sure the performance is actually better; I've only tested it on one machine.
You can view, comment on, or merge this pull request online at:
https://github.com/pfn/passifox/pull/670 Commit Summary
- Use Zepto.js instead of jQuery where possible
File Changes
- M chromeipass/background/event.js https://github.com/pfn/passifox/pull/670/files#diff-0 (12)
- M chromeipass/chromeipass.js https://github.com/pfn/passifox/pull/670/files#diff-1 (122)
- M chromeipass/manifest.json https://github.com/pfn/passifox/pull/670/files#diff-2 (2)
- A chromeipass/zepto.js https://github.com/pfn/passifox/pull/670/files#diff-3 (1664)
- A chromeipass/zepto.selector.js https://github.com/pfn/passifox/pull/670/files#diff-4 (85)
Patch Links:
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pfn/passifox/pull/670, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfQxWG6cL5ugi9kmuv_xR0gNtLbCCHSks5tKHI6gaJpZM4RdKIc .
Actually... I think I've found bugs in this. :\ I'll try to update it when I get the chance (but it might be a while from now).
You can probably do it without either
Update: I fixed the bug I had found (subframes were throwing errors). However, it's still not ideal. The problem is that chromeIPass makes the fundamentally incorrect assumption that all input fields become available together, and that they do so at a "nice" time. This isn't always the case (Javascript can add/remove fields to a form), and and when this assumption fails to hold, the password-generation "key" icon no longer auto-appears. Addressing this issue would seem to require quite a bit of surgery (essentially rewriting much of the extension), so I'm not sure I'll ever get the chance to address it.
Regarding jQuery vs. Zepto.js, Zepto.js might be avoidable with some care, but jQuery-UI is definitely required for the password-generation dialog UI; there's no getting around that, unless you write your own equivalent UI code.
Hi! This is an update to address the chromeIPass performance issue due to jQuery; it is intended to resolve issue #550.
It is somewhat ad-hoc and not well-written, but I think it should (?) work correctly. The idea is to use Zepto.js as a lightweight alternative to jQuery where possible, and load jQuery dynamically when
input
fields are actually detected. This prevents most subframes from loading jQuery, since generally few subframes haveinput
fields.I mainly tried to minimize the diff and avoid impacting the old code where possible (to make it easier to compare/understand), so that's why the code isn't very polished. I can fix the indentation issues, etc. if desired; it was a bit difficult to do this non-invasively since I would have had to re-indent and re-touch existing code as well.
One thing to note is that I also replaced the
setInterval
call withMutationObserver
. I'm not sure whether theobserve()
call needsattributes: true
instead ofattribute: false
. Please change this if needed. (I didn't set it lest there is a performance impact.)It would be great if someone could also test this and ensure that:
Testing it is important as I've only done limited testing with it on one machine.