mirror of
https://github.com/Ellpeck/ObsidianCustomFrames.git
synced 2024-11-25 18:48:35 +01:00
parent
2f6bff67f7
commit
6cf6eb04f2
1 changed files with 5 additions and 3 deletions
2
main.ts
2
main.ts
|
@ -100,9 +100,11 @@ class CustomFrameView extends ItemView {
|
||||||
for (let other of require("electron").remote.getCurrentWebContents().mainFrame.frames) {
|
for (let other of require("electron").remote.getCurrentWebContents().mainFrame.frames) {
|
||||||
if (frame.src.contains(new URL(other.url).host)) {
|
if (frame.src.contains(new URL(other.url).host)) {
|
||||||
other.executeJavaScript(`
|
other.executeJavaScript(`
|
||||||
|
(() => {
|
||||||
let style = document.createElement("style");
|
let style = document.createElement("style");
|
||||||
style.textContent = \`${this.frame.customCss}\`;
|
style.textContent = \`${this.frame.customCss}\`;
|
||||||
document.head.appendChild(style);
|
document.head.appendChild(style);
|
||||||
|
})();
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue