-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Zepto.js instead of jQuery where possible #670
base: master
Are you sure you want to change the base?
Conversation
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 ***@***.***> wrote:
Hi! This is an update to address the chromeIPass performance issue due to
jQuery; it is intended to resolve issue #550
<#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:
#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:
- https://github.com/pfn/passifox/pull/670.patch
- https://github.com/pfn/passifox/pull/670.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#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). 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.