mirror of
https://github.com/astefanutti/decktape.git
synced 2025-01-05 21:23:15 +03:00
Work-around Remark rendering issue with screen media emulation
This commit is contained in:
parent
f6e5797c15
commit
abe0f9098a
@ -16,6 +16,21 @@ class Remark {
|
||||
typeof remark === 'object' && typeof slideshow === 'object');
|
||||
}
|
||||
|
||||
async configure() {
|
||||
await this.page.emulateMedia(null);
|
||||
await this.page.evaluate(_ => {
|
||||
for (let j = 0; j < document.styleSheets.length; j++) {
|
||||
const sheet = document.styleSheets[j];
|
||||
if (!sheet.rules) continue;
|
||||
for (let i = sheet.rules.length - 1; i >= 0; i--) {
|
||||
if (sheet.rules[i].cssText.indexOf('@media print') >= 0) {
|
||||
sheet.deleteRule(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
slideCount() {
|
||||
return this.page.evaluate(_ => slideshow.getSlideCount());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user