[Mypal] #149-754623 Name field of bookmarks saved...

This commit is contained in:
Fedor 2020-05-07 14:46:09 +03:00
parent 88732f0a57
commit 5b479e5d2f
2 changed files with 18 additions and 10 deletions

View File

@ -387,11 +387,15 @@ var PlacesCommandHook = {
get uniqueCurrentPages() {
let uniquePages = {};
let URIs = [];
gBrowser.visibleTabs.forEach(function(tab) {
let spec = tab.linkedBrowser.currentURI.spec;
gBrowser.visibleTabs.forEach(tab => {
let browser = tab.linkedBrowser;
let uri = browser.currentURI;
let title = browser.contentTitle || tab.label;
let spec = uri.spec;
if (!tab.pinned && !(spec in uniquePages)) {
uniquePages[spec] = null;
URIs.push(tab.linkedBrowser.currentURI);
URIs.push({ uri, title });
}
});
return URIs;

View File

@ -600,15 +600,19 @@ var BookmarkPropertiesPanel = {
*/
_getTransactionsForURIList: function() {
var transactions = [];
for (var i = 0; i < this._URIs.length; ++i) {
var uri = this._URIs[i];
var title = this._getURITitleFromHistory(uri);
var createTxn = new PlacesCreateBookmarkTransaction(uri, -1,
PlacesUtils.bookmarks.DEFAULT_INDEX,
title);
for (let uri of this._URIs) {
// uri should be an object in the form { url, title }. Though add-ons
// could still use the legacy form, where it's an nsIURI.
let [_uri, _title] = uri instanceof Ci.nsIURI ?
[uri, this._getURITitleFromHistory(uri)] : [uri.uri, uri.title];
let createTxn =
new PlacesCreateBookmarkTransaction(_uri, -1,
PlacesUtils.bookmarks.DEFAULT_INDEX,
_title);
transactions.push(createTxn);
}
return transactions;
return transactions;
},
/**