nsIPlacesImportExportService 编辑
toolkit/components/places/nsIPlacesImportExportService.idl
Scriptable Provides methods for exporting Places data. 1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports
Last changed in Gecko 14.0 (Firefox 14.0 / Thunderbird 14.0 / SeaMonkey 2.11)In the past, this interface also offered methods for importing Places data, but those methods are now part of the BookmarkHTMLUtils.jsm JavaScript code module. The interface name has been kept for compatibility reasons for code using the export service.
Implemented by: @mozilla.org/import-export-service;1
as a service:
var placesImportExportService = Components.classes["@mozilla.org/import-export-service;1"] .getService(Components.interfaces.nsIPlacesImportExportService);
Method overview
void backupBookmarksFile(); |
void exportHTMLToFile(in nsILocalFile aFile); |
void importHTMLFromFile(in nsILocalFile aFile, in boolean aIsInitialImport); Obsolete since Gecko 14.0 |
void importHTMLFromFileToFolder(in nsILocalFile aFile, in PRInt64 aFolder, in boolean aIsInitialImport); Obsolete since Gecko 14.0 |
void importHTMLFromURI(in nsIURI aURI, in boolean aIsInitialImport); Obsolete since Gecko 14.0 |
Methods
backupBookmarksFile()
Backs up the bookmarks.html file.
void backupBookmarksFile();
Parameters
None.
exportHTMLToFile()
Saves the current bookmarks hierarchy to a bookmarks.html
file.
void exportHTMLToFile( in nsILocalFile aFile );
Parameters
aFile
- An
nsILocalFile
indicating where to save the newbookmarks.html
file.
importHTMLFromFile()
Obsolete since Gecko 14.0 (Firefox 14.0 / Thunderbird 14.0 / SeaMonkey 2.11) Note: This method has been removed; use the BookmarkHTMLUtils.jsm JavaScript code module instead.Loads the given bookmarks.html
file and replaces it with the current bookmarks hierarchy (if aIsInitialImport is true
) or appends it (if aIsInitialImport
is false
).
Three nsIObserverService
notifications are fired as a result of the import. "bookmarks-restore-begin" is fired just before the import is started. "bookmarks-restore-success" is fired right after the bookmarks are successfully imported. "bookmarks-restore-failed" is fired right after a failure occurs when importing the bookmarks. Observers will be passed through their data parameters either "html" if aIsInitialImport
is false
or "html-initial" if aIsInitialImport
is true
. The observer subject will be null
.
void importHTMLFromFile( in nsILocalFile aFile, in boolean aIsInitialImport );
Parameters
aFile
- The HTML file to import into Places.
aIsInitialImport
- Whether this is an initial import or not.
importHTMLFromFileToFolder()
Obsolete since Gecko 14.0 (Firefox 14.0 / Thunderbird 14.0 / SeaMonkey 2.11) Note: This method has been removed; use the BookmarkHTMLUtils.jsm JavaScript code module instead.Loads the given bookmarks.html file and puts it in the given folder.Three nsIObserverService
notifications are fired as a result of the import. "bookmarks-restore-begin" is fired just before the import is started. "bookmarks-restore-success" is fired right after the bookmarks are successfully imported. "bookmarks-restore-failed" is fired right after a failure occurs when importing the bookmarks. Observers will be passed through their data parameters either "html" if aIsInitialImport is false
or "html-initial" if aIsInitialImport
is true
. The observer subject will be an nsISupportsPRInt64
whose value is aFolder.
void importHTMLFromFileToFolder( in nsILocalFile aFile, in PRInt64 aFolder, in boolean aIsInitialImport );
Parameters
aFile
- The file to import.
aFolder
- The ID of the bookmarks folder into which to import the bookmarks.
aIsInitialImport
- Whether or not this is an initial import.
importHTMLFromURI()
Obsolete since Gecko 14.0 (Firefox 14.0 / Thunderbird 14.0 / SeaMonkey 2.11)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
Same thing as importHTMLFromFile()
, but takes a URI instead.
void importHTMLFromURI( in nsIURI aURI, in boolean aIsInitialImport );
Parameters
aURI
- The URI from which to import bookmarks.
aIsInitialImport
- Whether or not this is an initial import.
See also
- BookmarkHTMLUtils.jsm
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论