mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Before adding any markers to local HTML ensure we dont have any already
This commit is contained in:
parent
39b0cbd453
commit
64e2bb39b6
1 changed files with 13 additions and 0 deletions
|
|
@ -12,6 +12,19 @@ function iconURL() {
|
|||
|
||||
ShareExtension.prototype = {
|
||||
markHighlightSelection: () => {
|
||||
// First remove any previous markers, this would only normally happen during debugging
|
||||
try {
|
||||
const markers = window.document.querySelectorAll(
|
||||
`span[data-omnivore-highlight-start="true"],
|
||||
span[data-omnivore-highlight-end="true"]`
|
||||
)
|
||||
|
||||
for (let i = 0; i < markers.length; i++) {
|
||||
markers[i].remove();
|
||||
}
|
||||
} catch {
|
||||
// This should be OK
|
||||
}
|
||||
try {
|
||||
const sel = window.getSelection();
|
||||
if (sel.rangeCount) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue