зеркало из https://github.com/mozilla/ubiquity.git
Quit using document.URL which is unavailable in XULDocument.
This commit is contained in:
Родитель
17730f00c6
Коммит
1dbe81f78c
|
@ -212,8 +212,9 @@ var noun_type_tab = {
|
|||
};
|
||||
},
|
||||
suggest: function nt_tab_suggest(text, html, cb, selectedIndices)
|
||||
[CmdUtils.makeSugg(tab.document.title || tab.document.URL, null, tab,
|
||||
CmdUtils.matchScore(tab.match), selectedIndices)
|
||||
[CmdUtils.makeSugg(
|
||||
tab.document.title || tab.document.location.href,
|
||||
null, tab, CmdUtils.matchScore(tab.match), selectedIndices)
|
||||
for each (tab in Utils.tabs.search(text, CmdUtils.maxSuggestions))],
|
||||
};
|
||||
|
||||
|
|
|
@ -1139,7 +1139,8 @@ var gTabs = Utils.tabs = {
|
|||
name == null
|
||||
? [t for (t in gTabs)]
|
||||
: [t for (t in gTabs)
|
||||
if (let (d = t.document) d.title === name || d.URL === name)]),
|
||||
if (let (d = t.document)
|
||||
d.title === name || d.location.href === name)]),
|
||||
|
||||
// === {{{ Utils.tabs.search(matcher, maxResults) }}} ===
|
||||
// Searches for tabs by title or URL and returns an array of tab references.
|
||||
|
@ -1154,7 +1155,7 @@ var gTabs = Utils.tabs = {
|
|||
if (maxResults == null) maxResults = 1/0;
|
||||
for (let tab in gTabs) {
|
||||
let {document} = tab;
|
||||
let match = matcher(document.title) || matcher(document.URL);
|
||||
let match = matcher(document.title) || matcher(document.location.href);
|
||||
if (!match) continue;
|
||||
tab.match = match;
|
||||
if (results.push(tab) >= maxResults) break;
|
||||
|
|
|
@ -170,8 +170,8 @@ CmdUtils.CreateCommand({
|
|||
html: html,
|
||||
_MODIFIERS: {asList: this._lister} });
|
||||
},
|
||||
_lister: function clatab__lister({document}) "" + (
|
||||
<li>{document.title}<br/><code><small>{document.URL}</small></code></li>),
|
||||
_lister: function clatab__lister({document: d})
|
||||
String(<li>{d.title}<br/><code>{d.location.href}</code></li>),
|
||||
});
|
||||
|
||||
CmdUtils.CreateCommand({
|
||||
|
@ -336,7 +336,7 @@ CmdUtils.CreateCommand({
|
|||
execute: function tag_execute({object: {text, data}}) {
|
||||
var doc = CmdUtils.getDocument();
|
||||
var {tagging, bookmarks} = PlacesUtils;
|
||||
var currentURI = Utils.url(doc.URL);
|
||||
var currentURI = doc.documentURIObject;
|
||||
|
||||
if (!bookmarks.isBookmarked(currentURI)) {
|
||||
// create unfiled bookmark
|
||||
|
|
Загрузка…
Ссылка в новой задаче