Merge lp:~cando/zeitgeist-datasources/ff-private-browsing into lp:zeitgeist-datasources/0.8

Proposed by Stefano Candori
Status: Merged
Merged at revision: 114
Proposed branch: lp:~cando/zeitgeist-datasources/ff-private-browsing
Merge into: lp:zeitgeist-datasources/0.8
Diff against target: 21 lines (+4/-0)
1 file modified
firefox-libzg/extension/chrome/content/zeitgeist.xul (+4/-0)
To merge this branch: bzr merge lp:~cando/zeitgeist-datasources/ff-private-browsing
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
Review via email: mp+47430@code.launchpad.net

Description of the change

In this branch i've hopefully fixed the issue with private browsing in firefox...now when we surf in private mode the dataprovider doesn't send events to the daemon.

To post a comment you must log in.
115. By Stefano Candori

Quick fix

Revision history for this message
Michal Hruby (mhr3) wrote :

Great, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'firefox-libzg/extension/chrome/content/zeitgeist.xul'
2--- firefox-libzg/extension/chrome/content/zeitgeist.xul 2010-05-20 18:33:46 +0000
3+++ firefox-libzg/extension/chrome/content/zeitgeist.xul 2011-01-25 18:29:14 +0000
4@@ -6,6 +6,8 @@
5
6 var enable_googlemail = false;
7 var googlemail_view_regex = new RegExp("mail\\.google\\.com");
8+ var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
9+ .getService(Components.interfaces.nsIPrivateBrowsingService);
10
11 var debug = function (aMessage) {
12 var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
13@@ -109,6 +111,8 @@
14
15 var ZeitgeistProgressListener = {
16 onStateChange: function(aBrowser, aProgress, aRequest, aStateFlags) {
17+ var inPrivateBrowsingMode = pbs.privateBrowsingEnabled;
18+ if (inPrivateBrowsingMode) return;
19 if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) {
20 var uri = aBrowser.currentURI.spec;
21 var mimetype = aBrowser.contentDocument.contentType;

Subscribers

People subscribed via source and target branches