Pricing Blog

Editor slowing down on big project

  • yoelfdz-1273567656477200444

    yoelfdz

    1 year ago

    I'm still dealing with this issue. Working on the editor triggers custom actions and causes significant lag. I don't want to rush, but whenever someone from Team toddle is available to help, it would be much appreciated. 🙏🏼
  • erikbeus-1273572144701505566

    Erik Beuschau

    1 year ago

    Could you add some details on what kind of custom actions you're using/running? It's definitely possible to build actions that could slow down the performance. And currently, we run all actions within the canvas to mimic the real behaviour of the app.
  • yoelfdz-1273572603558236220

    yoelfdz

    1 year ago

    I think the main conflict is with a custom action for a interactive kanbas
  • yoelfdz-1273573310088609802

    yoelfdz

    1 year ago

    Is there anyway I can disable those on the editor only?
  • erikbeus-1273573994204893184

    Erik Beuschau

    1 year ago

    Yes. You could add a custom formula that detects whether you`re running the app in an iframe. You'll find examples of how to achieve that here https://stackoverflow.com/questions/326069/how-to-identify-if-a-webpage-is-being-loaded-inside-an-iframe-or-directly-into-t
  • yoelfdz-1273574714765344780

    yoelfdz

    1 year ago

    Ok, thanks Erik. Checking that
  • patrickmast-1273616166509613128

    Patrick Mast

    1 year ago

    Hey @, hope this can also help; To identify whether a webpage is being loaded inside an iframe or directly into the browser window, you can use JavaScript to compare the window and window.top objects. Here's how it works:

    1. When a page is loaded in an iframe: The window object refers to the current iframe's window. The window.top object refers to the topmost window, i.e., the main page that contains the iframe.
    2. When a page is loaded directly into the browser window: The window and window.top objects will be the same.

    function is_in_iframe (args, ctx) {
    if (window.self !== window.top) {
    // The page is loaded inside an iframe
    console.log("This page is being loaded inside an iframe.");
    return true;
    } else {
    // The page is loaded directly in the browser window
    console.log("This page is loaded directly into the browser window.");
    }
    return false
    }

    - window.self: Refers to the current window (or iframe) context.
    - window.top: Refers to the topmost window in the hierarchy.

    By comparing window.self and window.top, you can determine if the webpage is being loaded in an iframe or directly in the browser.
    - Preventing iframe embedding: Some websites use this check to block their content from being embedded in iframes (e.g., to prevent clickjacking).
    - Iframe-specific functionality: You can use this check to apply different behaviors or styling if your content is displayed within an iframe.

    Sample page in Toddle: https://running_in_iframe.toddle.site/
    And running in an iframe: https://patrick.link/now-in-iframe