Skip to content

Commit

Permalink
chore: use 'console.debug' to dump added nodes in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
iorate committed May 12, 2020
1 parent 74ad9ac commit 9ab447c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scripts/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ function onDOMContentLoaded(): void {
}

function onElementAdded(addedElement: HTMLElement): void {
// #if ENV === 'development'
console.log(addedElement.cloneNode(true));
// #endif
for (const entryHandler of window.ubContentHandlers!.entryHandlers) {
const entry = entryHandler.getEntry(addedElement);
if (!entry || entry.hasAttribute('data-ub-url')) {
Expand Down Expand Up @@ -261,6 +258,9 @@ function main(): void {
for (const record of records) {
for (const addedNode of record.addedNodes) {
if (addedNode.nodeType === Node.ELEMENT_NODE) {
// #if ENV === 'development'
console.debug(addedNode.cloneNode(true));
// #endif
onElementAdded(addedNode as HTMLElement);
}
}
Expand Down

0 comments on commit 9ab447c

Please sign in to comment.