|
@@ -18,7 +18,7 @@
|
|
|
* along with SingleFile. If not, see <http://www.gnu.org/licenses/>.
|
|
* along with SingleFile. If not, see <http://www.gnu.org/licenses/>.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-/* global CSSRule, HTMLElement */
|
|
|
|
|
|
|
+/* global CSSRule */
|
|
|
|
|
|
|
|
this.SingleFileCore = this.SingleFileCore || (() => {
|
|
this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
|
|
|
|
@@ -432,7 +432,9 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
|
|
|
|
|
preProcessPage() {
|
|
preProcessPage() {
|
|
|
this.doc.querySelectorAll("singlefile-infobar, singlefile-mask").forEach(element => element.remove());
|
|
this.doc.querySelectorAll("singlefile-infobar, singlefile-mask").forEach(element => element.remove());
|
|
|
- this.doc.body.querySelectorAll(":not(svg) title, meta").forEach(element => element instanceof HTMLElement && this.doc.head.appendChild(element));
|
|
|
|
|
|
|
+ if (this.options.win) {
|
|
|
|
|
+ this.doc.body.querySelectorAll(":not(svg) title, meta").forEach(element => element instanceof this.options.win.HTMLElement && this.doc.head.appendChild(element));
|
|
|
|
|
+ }
|
|
|
if (this.options.imageData) {
|
|
if (this.options.imageData) {
|
|
|
const dataAttributeName = DOM.imagesAttributeName(this.options.sessionId);
|
|
const dataAttributeName = DOM.imagesAttributeName(this.options.sessionId);
|
|
|
this.doc.querySelectorAll("img").forEach(imgElement => {
|
|
this.doc.querySelectorAll("img").forEach(imgElement => {
|