Issue #3449πŸ’¬ AnsweredOpened May 11, 2021by chiragkataria220 reactions

Switching pages calls canvas styles and scripts again and again

Quick answerby chiragkataria22

@artf Can you please help?

Read full answer below ↓

Question

Hi I am integrating page manager into my project. But the issue I am facing is that whenever I switch between pages it loads CSS and script files given in canvas object at the time of init, again and again. It makes the switching between pages slow. Implementation: grapesjs.init({ pageManager: { pages: [ { id: 'Page-1', styles: ``, // or a JSON of styles component: '', // or a JSON of components name: 'Page 1', }, ], }, canvas: { styles: [ '../assets/bootstrap/bootstrap.min.css', '../assets/platforma/platforma.min.css', '../assets/editor.css', ], scripts: [ '../assets/bootstrap/jquery-3.5.1.s...

Answers (3)

chiragkataria22β€’ May 12, 2021

@artf Can you please help?

artfβ€’ May 22, 2021

Unfortunately, switching pages creates a new iframe so, the behavior is correct. I preferred to remove previous iframes in order to keep the memory usage as low as possible. One solution might be to find a way to reuse previous iframes but that might cause context issues with external JS... so I'm...

GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @chiragkataria22. Thanks for sharing your report about Switching pages calls canvas styles and scripts again and again. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (CodeSandbox/JSFiddle) Your GrapesJS version number Bro...

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.