-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Opening the file page using Octotree doesn't trigger the extension #416
Comments
I believe |
Will have a look at it soon (next week) |
I found the reason why this is not working. Whenever you navigate between files, PRs or issues on GitHub, they fetch the HTML from the server via ajax and replaces the content of container with the loaded html. An event from type Octotree, is using basically the same technique to load the pages with a small difference. Other than GitHub.com they use a pjax jQuery plugin to achieve this. Since this is a jQuery plugin they dispatch all events on a wrapped Currently there are only two feasible options to solve this issue. Either creating an Octotree PR to dispatch also a native event on @josephfrazier do you have any preference? |
Wow, thanks for digging so deeply into this, @stefanbuck! I agree with you, Octotree should dispatch a native |
Any idea how GitHub does pjax? I mean if it uses jquery-pjax as Octotree, then it should trigger the event on |
I deobfuscated some javascript files from github.com. It looks like they have their own pjax implementation. I found a pjax module which does not depend on jQuery https://github.com/MoOx/pjax. From a brief look I would say this should be compatible with the github one. |
Yeah, it looks like https://github.com/MoOx/pjax might be the way to go, as EDIT: Hmm, https://github.com/MoOx/pjax may not actually emit EDIT 2: Perhaps https://github.com/OctoLinker/injection should switch back to using a |
One thing is that Octotree listens on |
That was one of the first things I tired out and it took me a while to understand why this is not working. I startet a little exploration with two new blank extensions. I added the same jQuery version to each of them. In extension A) I triggered a custom event via jQuery on the jQuery has his own event implementation which holds a list of all event listeners attached to an event. To me it looks like that those two extension does not share the same jQuery instance (which makes sense) and therefore the event list is also not shared. |
This sounds right, see jquery/jquery#2476 |
watch this |
It was fixed: ovity/octotree#490 |
Awesome 🎉 |
Browser name: Firefox/Chrome
Browser version: 57.0/63.0.3239.84
OctoLinker version: 4.15.1
URL and line number where issue occurs:
Expected behavior: Trigger the extension when opening the file page in screen.
Actual behavior: It doesn't trigger the extension when opening the page using Octotree, it only works after reloading the page or entering by using github.com itself.
The text was updated successfully, but these errors were encountered: