Skip to content

Commit

Permalink
Update content script
Browse files Browse the repository at this point in the history
  • Loading branch information
dewski committed Jun 6, 2023
1 parent 1780467 commit cc1032d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/content_script.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// A message sent from the background service worker notifying us one of the

import { commentPartialPath, walkPartialComments } from "./partials";
import { parsePartialComment, walkPartialComments } from "./partials";

// context menu items was selected.
chrome.runtime.onMessage.addListener(
Expand Down Expand Up @@ -44,7 +44,7 @@ const onMouseOver = (event: MouseEvent) => {

// For supported pages its expected that the root node will be a comment node
// with the layout partial.
if (document.firstChild && commentPartialPath(document.firstChild) !== null) {
if (document.firstChild && parsePartialComment(document.firstChild)?.begin) {
document.addEventListener("mouseover", onMouseOver, true);
} else {
// On page load clear the partials
Expand Down

0 comments on commit cc1032d

Please sign in to comment.