5 * data: PlacesVisit. Fired whenever a page is visited.
9 * data: PlacesBookmarkAddition. Fired whenever a bookmark
10 * (or a bookmark folder/separator) is created.
14 * data: PlacesBookmarkRemoved. Fired whenever a bookmark
15 * (or a bookmark folder/separator) is removed.
19 * data: PlacesBookmarkMoved. Fired whenever a bookmark
20 * (or a bookmark folder/separator) is moved.
24 * data: PlacesBookmarkGuid. Fired whenever a bookmark guid changes.
26 "bookmark-guid-changed",
28 * data: PlacesBookmarkKeyword. Fired whenever a bookmark keyword changes.
30 "bookmark-keyword-changed",
32 * data: PlacesBookmarkTags. Fired whenever tags of bookmark changes.
34 "bookmark-tags-changed",
36 * data: PlacesBookmarkTime.
37 * Fired whenever dateAdded or lastModified of a bookmark is explicitly changed
38 * through the Bookmarks API. This notification doesn't fire when a bookmark is
39 * created, or when a property of a bookmark (e.g. title) is changed, even if
40 * lastModified will be updated as a consequence of that change.
42 "bookmark-time-changed",
44 * data: PlacesBookmarkTitle. Fired whenever a bookmark title changes.
46 "bookmark-title-changed",
48 * data: PlacesBookmarkUrl. Fired whenever a bookmark url changes.
50 "bookmark-url-changed",
52 * data: PlacesFavicon. Fired whenever a favicon changes.
56 * data: PlacesVisitTitle. Fired whenever a page title changes.
60 * data: PlacesHistoryCleared. Fired whenever history is cleared.
64 * data: PlacesRanking. Fired whenever pages ranking is changed.
68 * data: PlacesVisitRemoved. Fired whenever a page or its visits are removed.
69 * This may be invoked when a page is removed from the store because it has no more
70 * visits, nor bookmarks. It may also be invoked when all or some of the page visits are
71 * removed, but the page itself is not removed from the store, because it may be
76 * data: PlacesPurgeCaches. Fired whenever changes happened that could not be observed
77 * through other notifications, for example a database fixup. When received, observers,
78 * especially data views, should drop any caches and reload from scratch.
83 [ChromeOnly, Exposed=Window]
84 interface PlacesEvent {
85 readonly attribute PlacesEventType type;
88 [ChromeOnly, Exposed=Window]
89 interface PlacesVisit : PlacesEvent {
93 readonly attribute DOMString url;
98 readonly attribute unsigned long long visitId;
101 * Time of the visit, in milliseconds since epoch.
103 readonly attribute unsigned long long visitTime;
106 * The id of the visit the user came from, defaults to 0 for no referrer.
108 readonly attribute unsigned long long referringVisitId;
111 * One of nsINavHistory.TRANSITION_*
113 readonly attribute unsigned long transitionType;
116 * The unique id associated with the page.
118 readonly attribute ByteString pageGuid;
121 * The frecency of the this page.
123 readonly attribute long long frecency;
126 * Whether the visited page is marked as hidden.
128 readonly attribute boolean hidden;
131 * Number of visits (including this one) for this URL.
133 readonly attribute unsigned long visitCount;
136 * Whether the URL has been typed or not.
137 * TODO (Bug 1271801): This will become a count, rather than a boolean.
138 * For future compatibility, always compare it with "> 0".
140 readonly attribute unsigned long typedCount;
143 * The last known title of the page. Might not be from the current visit,
144 * and might be null if it is not known.
146 readonly attribute DOMString? lastKnownTitle;
150 * Base class for properties that are common to all bookmark events.
152 [ChromeOnly, Exposed=Window]
153 interface PlacesBookmark : PlacesEvent {
155 * The id of the item.
157 readonly attribute long long id;
160 * The id of the folder to which the item belongs.
162 readonly attribute long long parentId;
165 * The type of the added item (see TYPE_* constants in nsINavBooksService.idl).
167 readonly attribute unsigned short itemType;
170 * The URI of the added item if it was TYPE_BOOKMARK, "" otherwise.
172 readonly attribute DOMString url;
175 * The unique ID associated with the item.
177 readonly attribute ByteString guid;
180 * The unique ID associated with the item's parent.
182 readonly attribute ByteString parentGuid;
185 * A change source constant from nsINavBookmarksService::SOURCE_*,
186 * passed to the method that notifies the observer.
188 readonly attribute unsigned short source;
191 * True if the item is a tag or a tag folder.
192 * NOTE: this will go away with bug 424160.
194 readonly attribute boolean isTagging;
197 dictionary PlacesBookmarkAdditionInit {
198 required long long id;
199 required long long parentId;
200 required unsigned short itemType;
201 required DOMString url;
202 required ByteString guid;
203 required ByteString parentGuid;
204 required unsigned short source;
206 required DOMString title;
207 required DOMString? tags;
208 required unsigned long long dateAdded;
209 required boolean isTagging;
210 required long long frecency;
211 required boolean hidden;
212 required unsigned long visitCount;
213 required unsigned long long? lastVisitDate;
216 [ChromeOnly, Exposed=Window]
217 interface PlacesBookmarkAddition : PlacesBookmark {
218 constructor(PlacesBookmarkAdditionInit initDict);
221 * The item's index in the folder.
223 readonly attribute long index;
226 * The title of the added item.
228 readonly attribute DOMString title;
231 * The tags of the added item.
233 readonly attribute DOMString tags;
236 * The time that the item was added, in milliseconds from the epoch.
238 readonly attribute unsigned long long dateAdded;
241 * The frecency of the page of this bookmark.
243 readonly attribute long long frecency;
246 * Whether the visited page is marked as hidden.
248 readonly attribute boolean hidden;
251 * Number of visits (including this one) for this URL.
253 readonly attribute unsigned long visitCount;
256 * Date of the last visit, in milliseconds since epoch.
258 readonly attribute unsigned long long? lastVisitDate;
261 dictionary PlacesBookmarkRemovedInit {
262 required long long id;
263 required long long parentId;
264 required unsigned short itemType;
265 required DOMString url;
266 required DOMString title;
267 required ByteString guid;
268 required ByteString parentGuid;
269 required unsigned short source;
271 required boolean isTagging;
272 boolean isDescendantRemoval = false;
275 [ChromeOnly, Exposed=Window]
276 interface PlacesBookmarkRemoved : PlacesBookmark {
277 constructor(PlacesBookmarkRemovedInit initDict);
279 * The item's index in the folder.
281 readonly attribute long index;
284 * The title of the the removed item.
286 readonly attribute DOMString title;
289 * The item is a descendant of an item whose notification has been sent out.
291 readonly attribute boolean isDescendantRemoval;
294 dictionary PlacesBookmarkMovedInit {
295 required long long id;
296 required unsigned short itemType;
297 DOMString? url = null;
298 required ByteString guid;
299 required ByteString parentGuid;
301 required ByteString oldParentGuid;
302 required long oldIndex;
303 required unsigned short source;
304 required boolean isTagging;
305 required DOMString title;
306 required DOMString? tags;
307 required long long frecency;
308 required boolean hidden;
309 required unsigned long visitCount;
310 required unsigned long long? lastVisitDate;
313 [ChromeOnly, Exposed=Window]
315 * NOTE: Though PlacesBookmarkMoved extends PlacesBookmark,
316 * parentId will not be set. Use parentGuid instead.
318 interface PlacesBookmarkMoved : PlacesBookmark {
319 constructor(PlacesBookmarkMovedInit initDict);
321 * The item's index in the folder.
323 readonly attribute long index;
326 * The unique ID associated with the item's old parent.
328 readonly attribute ByteString oldParentGuid;
331 * The item's old index in the folder.
333 readonly attribute long oldIndex;
336 * The title of the added item.
338 readonly attribute DOMString title;
341 * The tags of the added item.
343 readonly attribute DOMString tags;
346 * The frecency of the page of this bookmark.
348 readonly attribute long long frecency;
351 * Whether the visited page is marked as hidden.
353 readonly attribute boolean hidden;
356 * Number of visits (including this one) for this URL.
358 readonly attribute unsigned long visitCount;
361 * Date of the last visit, in milliseconds since epoch.
363 readonly attribute unsigned long long? lastVisitDate;
366 [ChromeOnly, Exposed=Window]
367 interface PlacesBookmarkChanged : PlacesBookmark {
369 * The updated last modified value in milliseconds.
371 readonly attribute long long lastModified;
374 dictionary PlacesBookmarkGuidInit {
375 required long long id;
376 required unsigned short itemType;
377 DOMString? url = null;
378 required ByteString guid;
379 required ByteString parentGuid;
380 required long long lastModified;
381 required unsigned short source;
382 required boolean isTagging;
385 [ChromeOnly, Exposed=Window]
386 interface PlacesBookmarkGuid : PlacesBookmarkChanged {
387 constructor(PlacesBookmarkGuidInit initDict);
390 dictionary PlacesBookmarkKeywordInit {
391 required long long id;
392 required unsigned short itemType;
393 DOMString? url = null;
394 required ByteString guid;
395 required ByteString parentGuid;
396 required ByteString keyword;
397 required long long lastModified;
398 required unsigned short source;
399 required boolean isTagging;
402 [ChromeOnly, Exposed=Window]
403 interface PlacesBookmarkKeyword : PlacesBookmarkChanged {
404 constructor(PlacesBookmarkKeywordInit initDict);
407 * Keyword the bookmark has currently.
410 readonly attribute ByteString keyword;
413 dictionary PlacesBookmarkTagsInit {
414 required long long id;
415 required unsigned short itemType;
416 DOMString? url = null;
417 required ByteString guid;
418 required ByteString parentGuid;
419 required sequence<DOMString> tags;
420 required long long lastModified;
421 required unsigned short source;
422 required boolean isTagging;
425 [ChromeOnly, Exposed=Window]
426 interface PlacesBookmarkTags : PlacesBookmarkChanged {
427 constructor(PlacesBookmarkTagsInit initDict);
430 * Tags the bookmark has currently.
433 readonly attribute sequence<DOMString> tags;
436 dictionary PlacesBookmarkTimeInit {
437 required long long id;
438 required unsigned short itemType;
439 DOMString? url = null;
440 required ByteString guid;
441 required ByteString parentGuid;
442 required long long dateAdded;
443 required long long lastModified;
444 required unsigned short source;
445 required boolean isTagging;
448 [ChromeOnly, Exposed=Window]
449 interface PlacesBookmarkTime : PlacesBookmarkChanged {
450 constructor(PlacesBookmarkTimeInit initDict);
453 * The added date in milliseconds.
455 readonly attribute long long dateAdded;
458 dictionary PlacesBookmarkTitleInit {
459 required long long id;
460 required unsigned short itemType;
461 DOMString? url = null;
462 required ByteString guid;
463 required ByteString parentGuid;
464 required DOMString title;
465 required long long lastModified;
466 required unsigned short source;
467 required boolean isTagging;
470 [ChromeOnly, Exposed=Window]
471 interface PlacesBookmarkTitle : PlacesBookmarkChanged {
472 constructor(PlacesBookmarkTitleInit initDict);
475 * The title of the changed bookmark.
477 readonly attribute DOMString title;
480 dictionary PlacesBookmarkUrlInit {
481 required long long id;
482 required unsigned short itemType;
483 required DOMString url;
484 required ByteString guid;
485 required ByteString parentGuid;
486 required long long lastModified;
487 required unsigned short source;
488 required boolean isTagging;
491 [ChromeOnly, Exposed=Window]
492 interface PlacesBookmarkUrl : PlacesBookmarkChanged {
493 constructor(PlacesBookmarkUrlInit initDict);
496 dictionary PlacesFaviconInit {
497 required DOMString url;
498 required ByteString pageGuid;
499 required DOMString faviconUrl;
502 [ChromeOnly, Exposed=Window]
503 interface PlacesFavicon : PlacesEvent {
504 constructor(PlacesFaviconInit initDict);
507 * The URI of the changed page.
509 readonly attribute DOMString url;
512 * The unique id associated with the page.
514 readonly attribute ByteString pageGuid;
517 * The URI of the new favicon.
519 readonly attribute DOMString faviconUrl;
522 dictionary PlacesVisitTitleInit {
523 required DOMString url;
524 required ByteString pageGuid;
525 required DOMString title;
528 [ChromeOnly, Exposed=Window]
529 interface PlacesVisitTitle : PlacesEvent {
530 constructor(PlacesVisitTitleInit initDict);
533 * The URI of the changed page.
535 readonly attribute DOMString url;
538 * The unique id associated with the page.
540 readonly attribute ByteString pageGuid;
543 * The title of the changed page.
545 readonly attribute DOMString title;
548 [ChromeOnly, Exposed=Window]
549 interface PlacesHistoryCleared : PlacesEvent {
553 [ChromeOnly, Exposed=Window]
554 interface PlacesRanking : PlacesEvent {
558 dictionary PlacesVisitRemovedInit {
559 required DOMString url;
560 required ByteString pageGuid;
561 required unsigned short reason;
562 unsigned long transitionType = 0;
563 boolean isRemovedFromStore = false;
564 boolean isPartialVisistsRemoval = false;
567 [ChromeOnly, Exposed=Window]
568 interface PlacesVisitRemoved : PlacesEvent {
570 * Removed by the user.
572 const unsigned short REASON_DELETED = 0;
575 * Removed by periodic expiration.
577 const unsigned short REASON_EXPIRED = 1;
579 constructor(PlacesVisitRemovedInit initDict);
582 * The URI of the page.
584 readonly attribute DOMString url;
587 * The unique id associated with the page.
589 readonly attribute ByteString pageGuid;
592 * The reason of removal.
594 readonly attribute unsigned short reason;
597 * One of nsINavHistoryService.TRANSITION_*
598 * NOTE: Please refer this attribute only when isRemovedFromStore is false.
599 * Otherwise this will be 0.
601 readonly attribute unsigned long transitionType;
604 * This will be true if the page is removed from store.
605 * If false, only visits were removed, but not the page.
607 readonly attribute boolean isRemovedFromStore;
610 * This will be true if remains at least one visit to the page.
612 readonly attribute boolean isPartialVisistsRemoval;
615 [ChromeOnly, Exposed=Window]
616 interface PlacesPurgeCaches : PlacesEvent {