Open burtonator opened 6 years ago
+1.
This feature would also be useful in many scenarios where the inline contents must be distinguished and selected by another script.
So, thinking in a broader approach, an option to enable the generation of the inline files with a data-
attribute, such as data-inliner-name
.
From this:
<script>
<!-- pdf.worker.js content goes here -->
</script>
To this:
<script data-inliner-name="pdf.worker.js">
<!-- pdf.worker.js content goes here -->
</script>
My example scenario:
<script data-inliner-name="pdf.worker.js">
<!-- pdf.worker.js content goes here -->
</script>
<script>
var workerSrc = document.querySelector('[data-inliner-name="pdf.worker.js"]').textContent
var blob = new Blob([workerSrc], {type: "text/javascript"});
PDFJS.workerSrc = window.URL.createObjectURL(blob);
</script>
Currently, this task must be done manually, but it seems useful enough to be implemented to this project. :)
This way you can track down why what style was sources from which link.