Skip to content

Commit

Permalink
fix: FireFox not support Highlight API #62
Browse files Browse the repository at this point in the history
  • Loading branch information
EINDEX committed Mar 4, 2024
1 parent 78bc900 commit 3e931db
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/pages/content/QuickCapture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ const clipPage = () => {
};

const setHighlight = (range: Range) => {
if(!highlights.has("copilot-highlight")) {
highlights.set('copilot-highlight', new Highlight())
try {
if (!highlights.has("copilot-highlight")) {
highlights.set('copilot-highlight', new Highlight())
}
const highlight = highlights.get('copilot-highlight');
highlight.add(range);
} catch (error) {
console.debug("platform not support highlight function")
}
const highlight = highlights.get('copilot-highlight');
highlight.add(range);
}


Expand Down

0 comments on commit 3e931db

Please sign in to comment.