Closed
Bug 501357
Opened 15 years ago
Closed 14 years ago
New history clearing features do not send onDeleteURI or onClearHistory Places events
Categories
(Firefox :: Bookmarks & History, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
status1.9.1 | --- | ? |
People
(Reporter: jes_jm, Unassigned)
References
Details
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1pre) Gecko/20090625 Shiretoko/3.5pre Beetle
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1pre) Gecko/20090625 Shiretoko/3.5pre Beetle
When the user removes a single website visit from the history, places sends an onDeleteURI event to all registered listeners. onClearHistory is sent when the entire history is cleared. Neither of these events is sent when the user chooses "forget this site" in the history sidebar or "clear recent history" for an hour.
Reproducible: Always
Steps to Reproduce:
1. Visit some web sites
2. Right click an entry in history sidebar and click "forget this site" OR
3. In tools menu, select "clear recent history" and choose the last hour as the time period
Actual Results:
No clear history or delete URI events were sent to an extension that had registered listeners for these
Expected Results:
Expected to receive a "delete URI" event for both
Reporter | ||
Updated•15 years ago
|
Version: unspecified → 3.5 Branch
Comment 1•15 years ago
|
||
There are a number of API's that we have that don't actually notify observers sadly.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 2•15 years ago
|
||
Well... I'm still trying to hunt down the code for the "forget this site" code, but it's odd that "clear recent history" isn't working. It looks like it _should_ send the same signal if clearing all history or just an hour, but I've doublechecked and no "clear history" signal is received by observers
from browser/content/browser/sanitize.js:
if (this.range)
globalHistory.QueryInterface(Components.interfaces.nsIBrowserHistory_MOZILLA_1_9_1_ADDITIONS).removeVisitsByTimeframe(this.range[0], this.range[1]);
else
globalHistory.removeAllPages();
try {
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
os.notifyObservers(null, "browser:purge-session-history", "");
}
catch (e) { }
Reporter | ||
Comment 3•15 years ago
|
||
It looks like "forget this host" needs the code added near the
// History comment inside the function
removeDataFromDomain
in browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
Comment 4•15 years ago
|
||
The new clear recent history by timeframe feature is backed by nsIBrowserHistory.removeVisitsByTimeframe() [1], implememented at [2], which as Shawn points out doesn't notify for each deleted visit or URI, only on begin/end batch. When you remove all history using the clear recent history window, 3.5 acts the same as 3.0's clear private data window and calls nsIBrowserHistory.removeAllPages(), which does notify nsINavHistoryObservers with onClearHistory() [3].
Ideally we should be notifying nsINavHistoryObservers in the timeframe case too, but we're not. Maybe there should be a new method onClearHistoryTimeframe()?
[1] http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/public/nsIBrowserHistory.idl#114
[2] http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/src/nsNavHistory.cpp#4713
[3] http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/src/nsNavHistoryExpire.cpp#282
Updated•15 years ago
|
Flags: wanted1.9.1.x?
Reporter | ||
Comment 5•15 years ago
|
||
I maintain an extension that replaces the history menu, and would rely on these two signals to know to redraw.
Can anyone help me out to find a workaround until signals are added? How does the firefox history menu know to redraw because a site was forgotten or an hour of history was cleared? Or would someone describe how to overload the javascript functions that the firefox gui triggers to forget timeframe or to forget a website (in the history sidebar)?
Any help would be much appreciated.
Reporter | ||
Comment 6•15 years ago
|
||
Nevermind found my own answer... just looked through the C source code and it looks like both of these bulk delete functions send a Begin/EndUpdateBatch.
Reporter | ||
Comment 7•15 years ago
|
||
Just from one developer's point of view... the code already present that gives Begin/EndUpdateBatch signals is sufficient for me, and I'd be fine with the ticket closing if https://developer.mozilla.org/en/nsINavHistoryObserver gets updated to detail that the new deletion mechanisms use the bulkupdate signals. I'll submit a change request for that documentation. Other folks, are observer signal changes still necessary here?
Updated•15 years ago
|
status1.9.1:
--- → ?
Flags: wanted1.9.1.x?
Comment 8•15 years ago
|
||
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".
In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body contains places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.
Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.
Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
Comment 9•14 years ago
|
||
Should be fixed by bug 630240, the only case where we don't knotify pages removal is onClearHistory, in this case anything that is not a bookmark is removed, so notifying has a low value.
You need to log in
before you can comment on or make changes to this bug.
Description
•