mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	Don't search note by url if url begins with 'about:'
This commit is contained in:
		| @@ -16,17 +16,20 @@ 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) { | ||||||
|     const notes = clipperInboxNote.searchNotesInSubtree( |     //Avoid searching for empty of browser pages like about:blank | ||||||
|         formatAttrForSearch({ |     if (pageUrl.trim().length > 1 && pageUrl.trim().indexOf('about:') != 0 ){ | ||||||
|             type: 'label', |         const notes = clipperInboxNote.searchNotesInSubtree( | ||||||
|             name: "pageUrl", |             formatAttrForSearch({ | ||||||
|             value: pageUrl |                 type: 'label', | ||||||
|         }, true) |                 name: "pageUrl", | ||||||
|     ); |                 value: pageUrl | ||||||
|  |             }, true) | ||||||
|  |         ); | ||||||
|  |  | ||||||
|     for (const note of notes) { |         for (const note of notes) { | ||||||
|         if (note.getOwnedLabelValue('clipType') === 'note') { |             if (note.getOwnedLabelValue('clipType') === 'note') { | ||||||
|             return note; |                 return note; | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user