mirror of
https://github.com/Ellpeck/ObsidianCustomFrames.git
synced 2024-11-22 09:43:30 +01:00
parent
2f6bff67f7
commit
6cf6eb04f2
1 changed files with 5 additions and 3 deletions
8
main.ts
8
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");
|
(() => {
|
||||||
style.textContent = \`${this.frame.customCss}\`;
|
let style = document.createElement("style");
|
||||||
document.head.appendChild(style);
|
style.textContent = \`${this.frame.customCss}\`;
|
||||||
|
document.head.appendChild(style);
|
||||||
|
})();
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue