Skip to content
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

Start the notary query when the tab loads #60

Open
daveschaefer opened this issue Jul 19, 2012 · 5 comments · May be fixed by #159
Open

Start the notary query when the tab loads #60

daveschaefer opened this issue Jul 19, 2012 · 5 comments · May be fixed by #159
Assignees

Comments

@daveschaefer
Copy link
Collaborator

It looks like some queries actually don't start until the user views the tab? Verify if this is or isn't the case. If we're not starting the query right away we should try to - that will save time and make the extension more snappy/have a better UI.

@ghost ghost assigned daveschaefer Jul 19, 2012
@daveschaefer
Copy link
Collaborator Author

From MDN: "[using addProgressListener on a tabbrowser] will only get events from the browser [tab] that is currently displayed at the time the event occurs. In order to listen to events from all browsers, including those not currently being displayed [you must use gBrowser.addTabsProgressListener on the global browser]".

"The progress listener should be based on the nsIWebProgressListener interface with an additional "browser" argument as the first argument of every method, which is the browser (not = gBrowser) where the event occurred." ref

@ghost
Copy link

ghost commented Jun 19, 2014

If you look at this gist: https://gist.github.com/lambdor/8824a4e04ad91373fda2

Yes, we could start the querying in onLocationChange. This should be an easy change.

But we could start querying even sooner on the first onStateChange call (if the user's preference is set to "contact notaries for all HTTPS sites"). However, this would require some restructuring in the query-callback-process functionality because updateStatus requires the certificate already. The restructuring I have in mind would involve two asynchronous calls waiting for each other: one for querying the notaries and one for retrieving the certificate. These then will be merged together and finally do the comparison. I already started with some restructuring and parameter reducing in the lambdor/Perspectives@a3d3acbbd471b930a8fea22e2f729adcc8446294 branch. Also see #85.

@ghost
Copy link

ghost commented Jun 22, 2014

I implemented this now, but it's still work in progress, see the tabinfo_restructuring branch.

@ghost
Copy link

ghost commented Jun 22, 2014

Btw: I think we should split up the functionality even more. One file dealing with Perspectives core functionality and one file dealing with the client interaction.
core functionality: queryNotaries, querySingleNotary, notaryAjaxCallback, notaryQueriesComplete, updateStatus
client functionality: set notifications and favicon, manage tabinfos, fetch certificates etc. Some of these have to be extracted and returned as a result from the core functionality.

This would also allow for easier testing.

@ghost
Copy link

ghost commented Jun 28, 2014

Please try the new commit in tabinfo_restructuring! It should immediately start querying, handle redirects correctly (www.github.com -> github.com), respect "only contact on certificate security error" preference and update states when selecting a different tab. Whew!

@ghost ghost linked a pull request Nov 16, 2014 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant