mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	fix copy link in browser, closes #4682
This commit is contained in:
		@@ -487,12 +487,14 @@ function areObjectsEqual () {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function copyHtmlToClipboard(content) {
 | 
					function copyHtmlToClipboard(content) {
 | 
				
			||||||
    const clipboardItem = new ClipboardItem({
 | 
					    function listener(e) {
 | 
				
			||||||
        'text/html': new Blob([content], {type: 'text/html'}),
 | 
					        e.clipboardData.setData("text/html", content);
 | 
				
			||||||
        'text/plain': new Blob([content], {type: 'text/plain'})
 | 
					        e.clipboardData.setData("text/plain", content);
 | 
				
			||||||
    });
 | 
					        e.preventDefault();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    navigator.clipboard.write([clipboardItem]);
 | 
					    document.addEventListener("copy", listener);
 | 
				
			||||||
 | 
					    document.execCommand("copy");
 | 
				
			||||||
 | 
					    document.removeEventListener("copy", listener);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user