Bewertungen für Bookmark Highlighter
Bookmark Highlighter von Carey Tilden
4 Bewertungen
- Bewertet mit 4 von 5 Sternenvon Moneky, vor 3 JahrenThis addon will not work if the page contains some url like: mailto:name@email.com
You should check url format before run bookmark.search:
var pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
'(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
for (var i = 0; i < m.hrefs.length; i++) {
var href = m.hrefs[i];
if(!pattern.test(href))
continue;
try {
bookmarkSearches.push(browser.bookmarks.search({ url: href }));
} catch (error) {
console.log(error);
console.log(href);
}
}
Thanks. - Bewertet mit 4 von 5 Sternenvon Ahmmad Ismail, vor 6 Jahren1 start missing because it does not work in some sites. I found the reason.
If the link is href="mysite.com/link1.html" Then it will work.
But, if the link is href="/link1.html" Then it will not work.
You can check it on https://www.lynda.com/subject/all
If you bookmark some of the links and refresh then the appearance will not change. Probably because the links do not contain the domain address. - Bewertet mit 4 von 5 Sternenvon vidigal, vor 6 JahrenGood Idea... Unluckly the site where i need this (github search pages) handle pagination via ajax, so i need to reload on each subsequent page to get it work. Probably you should use a delegate event attached to the body to resolve this issue.
- Bewertet mit 4 von 5 Sternenvon Firefox-Benutzer 12957254, vor 7 JahrenThe main reason I use firefox! The only problem is that it doesn't work in every site (toranoana for example).
Antwort des Entwicklers
geschrieben am vor 7 JahrenIt looks like some links on your example site are being added after the extension has a chance to execute. I haven't been able to find a way to fix this problem, but if I do, I'll post another reply.