14 lines · 453 B · JavaScript
RawDownload
import pdfobject from 'pdfobject'; window.customElements.define(  'pdf-object',  class extends HTMLElement {    connectedCallback() {      // since the web-component is defined after the DOM is ready, it is safe to look at the children.      const fallbackLink = this.innerHTML; // eslint-disable-line wc/no-child-traversal-in-connectedcallback      pdfobject.embed(this.getAttribute('src'), this, {        fallbackLink,      });    }  },);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t