Ellpeck / ObsidianCustomFrames

An Obsidian plugin that turns web apps into panes using iframes with custom styling. Also comes with presets for Google Keep, Todoist and more.
MIT License
578 stars 30 forks source link

Repeated crasing until site loaded #25

Closed brimwats closed 2 years ago

brimwats commented 2 years ago

I use custom frames for amazing marvin, a task app. Since two updates ago (2.2.1 I think) whenever I open the custom frame on the sidebar or in the note it crashes obsidian, i reopen, it crashes again, I reopen, crashes, and then the third reopen makes it work. It's too quick to load the console to get an error—any ideas?

Ellpeck commented 2 years ago

Hrm. I'm not sure how to get a hold of the crash logs, but those are really what I'd need. Can you share your Custom Frames settings file? It should be in .obsidian/plugins/obsidian-custom-frames/data.json. Thanks!

brimwats commented 2 years ago

sure!

{
  "frames": [
    {
      "url": "https://app.amazingmarvin.com",
      "displayName": "Marvin",
      "icon": "layout-list",
      "minimumWidth": 0,
      "customCss": "",
      "hideOnMobile": true
    }
  ],
  "padding": 5
}
brimwats commented 2 years ago

okay, so it works in the sidebar after multiple restarts, but never works in markdown view

Ellpeck commented 2 years ago

It's very strange that it would outright crash Obsidian instead of just throwing an exception. Does it also crash completely in Markdown mode?

Ellpeck commented 2 years ago

Can you try removing and re-adding the frame in the Custom Frames settings? Some settings changed since you made your frame, and it might just be a backwards compatibility issue.

brimwats commented 2 years ago

Can you try removing and re-adding the frame in the Custom Frames settings? Some settings changed since you made your frame, and it might just be a backwards compatibility issue.

just did this, reloaded obsidian, and then tried "open Marvin" and it hard crashed again

brimwats commented 2 years ago

Here's a recording: Obsidian_qoAIHIp2cY

In markdown mode it never fully loads, it just crash loops obsidian. I'll record it

brimwats commented 2 years ago

Here's a recording of it crashing 4x

Obsidian_JMW6mZoU9J

The only way out of this crash loop is to edit the note with an external file editor

Ellpeck commented 2 years ago

If you start Obsidian from a command line, does it display any more informatino about the crash, by chance?

brimwats commented 2 years ago

this is all I get--is there a certain command

C:\Users\bri\AppData\Local\Obsidian>Obsidian.exe C:\Users\bri\AppData\Local\Obsidian> 2022-04-13 22:27:00 Loading updated app package C:\Users\bri\AppData\Roaming\obsidian\obsidian-0.14.6.asar 2022-04-13 22:27:00 Checking for update using Github 2022-04-13 22:27:01 Success. 2022-04-13 22:27:01 Latest version is 0.14.6 (insider) 2022-04-13 22:27:01 App is up to date.

Ellpeck commented 2 years ago

Hmm, it was worth a shot. Lishid reminded me that it might be because of the installer version you have of Obsidian. If you go into the settings, it doesn't just say the Obsidian version but also the Obsidian Installer version. That might be the reason it breaks, because the installer version dictates the version of Electron that Obsidian uses, which is what makes Custom Frames possible!

brimwats commented 2 years ago

i have the most up to date installer: image

here's debug info

SYSTEM INFO:
    Obsidian version: v0.14.6
    Installer version: v0.14.5
    Operating system: Windows 10 Education 10.0.22000
    Login status: logged in
    Catalyst license: insider
    Insider build toggle: on
    Live preview: on
    Legacy editor: off
    Base theme: light
    Community theme: Minimal
    Snippets enabled: 18
    Safe mode: off
    Plugins installed: 101
    Plugins enabled: 80
        1: Minimal Theme Settings
        2: Style Settings
        3: Folder Note Core
        4: Templater
        5: Collapse All
        6: Customizable Page Header and Title Bar
        7: Reset Font Size
        8: Advanced URI
        9: Another Quick Switcher
        10: Bartender
        11: Better Command Palette
        12: Breadcrumbs
        13: Calendar
        14: Code Editor Shortcuts
        15: Contextual Typography
        16: Core Search Assistant
        17: Customizable Sidebar
        18: Dataview
        19: Excel to Markdown Table
        20: Hider
        21: Grandfather
        22: Format Hotkeys
        23: Homepage
        24: Hotkey Helper
        25: Zoom
        26: Word Sprint
        27: Webhook Plugin
        28: Various Complements
        29: Recent Files
        30: QuickAdd
        31: Quick Explorer
        32: Plugin Changelogs
        33: Pane Relief
        34: Outliner
        35: Obsidian Tabs
        36: Sentence Navigator
        37: File Info Panel
        38: Smarter Markdown Hotkeys
        39: Cycle through Panes
        40: Toggle Readable Line Length
        41: File Explorer Note Count
        42: Kanban
        43: Key Promoter
        44: LanguageTool Integration
        45: MySnippets
        46: Multi-Column Markdown
        47: Obsidian Leaflet
        48: MetaEdit
        49: Longform
        50: Local images
        51: Linked Data Vocabularies
        52: Supercharged Links
        53: Tag Wrangler
        54: Zoottelkeeper Plugin
        55: File path to URI
        56: Link Archive
        57: Tweet to Markdown
        58: Settings Search
        59: Footnote Shortcut
        60: Obsidian Charts
        61: Dynamic Table of Contents
        62: Obsidian Memos
        63: Periodic Notes
        64: Hover Editor
        65: AidenLx's Folder Note
        66: Zotero Desktop Connector
        67: Waypoint
        68: Banners
        69: Markdown Table Editor
        70: Advanced Tables
        71: Custom Frames
        72: AidenLx's Folder Note - folderv component
        73: Macros
        74: Limelight
        75: Open with
        76: List Modified
        77: Chat View
        78: Obsidian42 - BRAT
        79: Active Visual Line
        80: Creases

RECOMMENDATIONS:
    Custom theme: for cosmetic issues, please first try updating your theme to latest. If still not fixed, please try to make the issue happen in the help vault or disable community theme and snippets.
    Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the help vault or disable community plugins.
Ellpeck commented 2 years ago

Hrm. Can you reproduce this issue with any other websites?

Edit: It'd also be great to know if another plugin is interfering somehow. Can you create a new vault and just install Custom Frames on it and nothing else, and see if the issue still happens?
Ideally, you'd just copy over the Custom Frames settings file from your main vault so that you know it's the exact same settings.

brimwats commented 2 years ago

sorry it took a couple days

Edit: It'd also be great to know if another plugin is interfering somehow. Can you create a new vault and just install Custom Frames on it and nothing else, and see if the issue still happens?

started a new vault and just copied over CF, is still immediately crashes on the left sidebar. it also crashes any other open vaults

it also crashes in markdown / editor view

Hrm. Can you reproduce this issue with any other websites?

this is the only one i care about so I haven't. I've tried it on test vault and my vault and the notion and twitter one work in document and in sidebar

so it seems like it's Marvin specifically.

brimwats commented 2 years ago

Hrm. Can you reproduce this issue with any other websites?

After I made the notion custom frame I went back and tried to reopen marvin in the sidebar. Now it acts the same as the editor custom frame, and the vault cannot be opened w/o crashing. no other plugins

brimwats commented 2 years ago

more info: I can only have a Marvin frame, if I have any others Marvin no longer works

brimwats commented 2 years ago

spoke too soon—I can now no longer have a marvin frame, Custom-Frames crashes obsidian immediately

here are all the data files:

{
  "frames": [
    {
      "url": "https://app.amazingmarvin.com",
      "displayName": "Marvin",
      "icon": "layout-list",
      "zoomLevel": 1,
      "customCss": "",
      "hideOnMobile": true
    }
  ],
  "padding": 5
}
{
    "id": "obsidian-custom-frames",
    "name": "Custom Frames",
    "version": "2.4.0",
    "minAppVersion": "0.14.5",
    "description": "A plugin that turns web apps into panes using iframes with custom styling. Also comes with presets for Google Keep, Todoist and more.",
    "author": "Ellpeck",
    "authorUrl": "https://ellpeck.de",
    "isDesktopOnly": false
}
.custom-frames-view {
    padding: 0 !important;
    overflow: hidden !important;
}

.custom-frames-view-file {
    padding: 0;
    overflow: auto;
}

.custom-frames-frame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
    background-clip: content-box;
}

.custom-frames-add {
    margin-left: 10px;
}

.custom-frames-show {
    margin-bottom: 18px;
}

.custom-frames-support {
    max-width: 50%;
    width: 400px;
    height: auto;
}
brimwats commented 2 years ago

I also tried this for debugging: loading obsidian over and over but with one section of the CSS taken out at a time. So like removing

.custom-frames-support {
    max-width: 50%;
    width: 400px;
    height: auto;
}

from the css file, loading obsidian, watching it crash, undoing and removing another section

nothing seemed to make a difference

brimwats commented 2 years ago

@Ellpeck any chance that the recent releases might affect this? can try again if needed

Ellpeck commented 2 years ago

Please try to do any tests you can think of! I don't really hvae a lead on this yet, unfortunately.

brimwats commented 2 years ago

So I thought it got worse: I added Marvin, and reloaded obsidian like instructions said. Something truly weird happened. everything went black and obsidian jumped up to using almost 5000MB of memory, so I force closed it. I reopened it and marvin seems to work again?

brimwats commented 2 years ago

So I can no longer "reload app without saving" with Custom Frames enabled. I just get this: image

Here are all the errors before I used that command image

brimwats commented 2 years ago

I pinged Licat in the Insider Desktop discord

Ellpeck commented 2 years ago

It's getting more and more likely that this is an issue with Electron and its webviews somehow causing issues or incompatibility with your machine and the sites you're testing with.

I'll create a test version for you that uses iframes rather than webviews on desktop to see if that fixes the issues. It won't be a permanent feature (sorry!), but it'll allow us to make 100% sure that it's an Electron bug, which'll mean that we'll be able to pass it onto them.

Ellpeck commented 2 years ago

Okay, please try with this version! This is just the main script, and you'll have to unzip it and put it into the plugin's directory and replace the main script that is already there.

This version has a bunch of features disabled (the ones that are also disabled on mobile!), but that's because it's just a test version. I decided that, if this does fix the issues, I might add a toggle option to force iframes on desktop for people who are having the same issues as you.

main.zip

brimwats commented 2 years ago

this works PERFECTLY! image

what features are disabled? I'm not seeing anything super different.

I might add a toggle option to force iframes on desktop for people who are having the same issues as you.

can you make the toggle per-frame? that would be the best of both worlds probably!

Ellpeck commented 2 years ago

Yea, I can make it per-frame. A few things are missing, like the ability to inject custom CSS (which I can re-add even for iframes on Desktop though), and the security is a lot tighter for iframes than it is for webviews, so a few sites might not work as well as with webviews.

I'm going to close this issue once I add the toggle, but I'll lock it since I'm counting this as resolved at least for Custom Frames itself. Thanks so much for all the help figuring this out!