Skip to content

Commit 7ab9cd9

Browse files
authored
Add loading="lazy" to iframe (#383)
Lazy loads the utterances iframe
1 parent 23860d6 commit 7ab9cd9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const url = `${utterancesOrigin}/utterances.html`;
8080
script.insertAdjacentHTML(
8181
'afterend',
8282
`<div class="utterances">
83-
<iframe class="utterances-frame" title="Comments" scrolling="no" src="${url}?${param(attrs)}"></iframe>
83+
<iframe class="utterances-frame" title="Comments" scrolling="no" src="${url}?${param(attrs)}" loading="lazy"></iframe>
8484
</div>`);
8585
const container = script.nextElementSibling as HTMLDivElement;
8686
script.parentElement!.removeChild(script);

0 commit comments

Comments
 (0)