-
Notifications
You must be signed in to change notification settings - Fork 44
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
multiple instances on one page #7
Comments
The extension used to check I haven’t seen any websites besides mine using the script so I don’t think it isn’t very important issue as for now. |
JS is inherently single-threaded, so one of the instances is bound to create the element first, right? Eh, anyway, you're right - it isn't a big issue. |
The problem is that flying-focus.js can be initialized either before or after the extension, depending on where script element is (head or end of the body). |
exactly, so whichever happens first gets to continue running, the other On Fri, Dec 27, 2013 at 5:13 PM, Nikita Vasilyev
|
CodeCombat is using it right now, and I see the issue. (I don't mind it at all; just adding an example of a site that uses it.) |
@slang800, that would work. I don’t have much time to test but I’ll accept a pull request. @nwinter nice, I’m a fan! I just listed it on newly created In the Wild wiki page. |
If I have the flying focus chrome plugin installed and I visit a site that uses the flying focus script, 2 instances of flying focus run on the same page. This creates 2 separate elements (both with the id
flying-focus
) and they are both animated.The fact that this happens doesn't actually break anything (they just overlap), and it's not really a performance concern since it's such a light plugin. Rather, it simply feels wrong to have 2 of them running at the same time, especially since both of the elements created have the same id.
So, flying-focus should check if the
#flying-focus
element has already been created, and exit if it has, to prevent multiple instances.The text was updated successfully, but these errors were encountered: