|
|
|
@ -16,6 +16,8 @@ const htmlSanitizer = require('../../services/html_sanitizer');
|
|
|
|
const {formatAttrForSearch} = require("../../services/attribute_formatter");
|
|
|
|
const {formatAttrForSearch} = require("../../services/attribute_formatter");
|
|
|
|
|
|
|
|
|
|
|
|
function findClippingNote(clipperInboxNote, pageUrl) {
|
|
|
|
function findClippingNote(clipperInboxNote, pageUrl) {
|
|
|
|
|
|
|
|
//Avoid searching for empty of browser pages like about:blank
|
|
|
|
|
|
|
|
if (pageUrl.trim().length > 1 && pageUrl.trim().indexOf('about:') != 0 ){
|
|
|
|
const notes = clipperInboxNote.searchNotesInSubtree(
|
|
|
|
const notes = clipperInboxNote.searchNotesInSubtree(
|
|
|
|
formatAttrForSearch({
|
|
|
|
formatAttrForSearch({
|
|
|
|
type: 'label',
|
|
|
|
type: 'label',
|
|
|
|
@ -29,6 +31,7 @@ function findClippingNote(clipperInboxNote, pageUrl) {
|
|
|
|
return note;
|
|
|
|
return note;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|