Labs/Jetpack/JEP/31: Difference between revisions

Jump to navigation Jump to search
Blanked the page
(Blanked the page)
Line 1: Line 1:
{{draft}}


== JEP 31 - Places Support ==
* Champion: Aza Raskin <aza at mozilla dot com>
* Editors: David Dahl <ddahl at mozilla dot com>
* Status: Implementing
* Type: API Track
* Created: 19 Nov 2009
* Reference Implementation: None
* Relevant Bugs:
* [[Labs/Jetpack/JEPs|JEP Index]]
=== Introduction and Rationale ===
This JEP describes an API for accessing Firefox Places (bookmarks and history)
=== Proposal ===
We want to allow developers to be able to search bookmarks and history as well as add and perhaps edit bookmarks via Jetpack.
== A minimal amount of API ==
(for now)
=== Searching ===
<pre class="brush:js;">
let places = jetpack.places.find("cnn.com"); // searches both History and Bookmarks
// 'places' looks like an array of objects:
[
  { url:"cnn.com", kind: 'history', visitDate: '2009-11-20 12:00:09', ... },
  { url: "video.cnn.com", kind: 'bookmark', lastVisit: '2009-11-03 09:45:23', ...}
]
let places = jetpack.history.find("cnn.com"); // only search history
let places = jetpack.bookmarks.find("cnn.com") // only search bookmarks
</pre>
=== Create a bookmark ===
<pre class="brush:js;">
jetpack.bookmarks.create(
  { title:'foo.com',
    url:'http://foo.com',
    tags: ['fun', 'technical'],
    path: 'computers/tech/reading' // <-- if the 'path' does not exist create it?
  }
);
</pre>
564

edits

Navigation menu