Uncaught (in promise) DOMException: The operation is insecure

Hello, in FIrefox (this doesn’t seem to be the case in Chrome), I get ‘Uncaught (in promise) DOMException: The operation is insecure.’ and ‘Too many calls to Location or History APIs within a short timeframe.’ when switching a couple of times between different views that contain the scheduler. How do I avoid this?

Hello @HVossi92,

It’s hard to suppose what exactly goes wrong, so it will be helpful if you provide details on initializing and destroying during tab switch, like follows:

 mounted() {
    scheduler = Scheduler.getSchedulerInstance();


...
  unmounted() {
    this.scheduler.destructor();
  },

Or send me a simplified demo with install and run instruction(but without scheduler sources), that I will be able to run locally and reproduce the issue.

Kind regards,

Hello Siarhei thank you for your reply,
I am using SchedulerStatic, so I can’t get an instance. I can call the destructor, but then I have to refresh the page to re-initialize the scheduler.
This is what I do:
` onMount(async () => {
if (scheduler) {
scheduler.clearAll();
}
await import(‘$lib/dhtmlx/scheduler/sources/dhtmlxscheduler.js’);
let newScheduler: SchedulerStatic = (window as any).scheduler;
scheduler = configureTimelineScheduler(newScheduler, units) as SchedulerStatic;
scheduler.config.drag_move = isDragAllowed;
scheduler.config.header = null;
scheduler.config.dblclick_create = isDblClickCreateEnabled;
initScheduler($page, addEventHandlers, scheduler);
});

onDestroy(() => {
removeSchedulerEvents(scheduler);
});`

`export function configureTimelineScheduler(scheduler: SchedulerStatic, units: SelectOption[]) {
if (!scheduler) return;
scheduler.plugins({
tooltip: true,
key_nav: true,
cookie: true,
timeline: true,
active_links: true,
treetimeline: false,
daytimeline: true,
minical: true,
url: true,
limit: true,
multisection: true,
multiselect: true,
units: true,
});

scheduler.config.details_on_create = true;

`

So I basically overwrite the scheduler everytime I switch pages, due to different layouts and functionality.

Hello @HVossi92 ,

Thank you for the details. As the issue occurs specifically in Firefox, it can be connected with various reasons, so it will be helpful if you send me a simplified demo, with all necessary files(excluding scheduler sources), and install/run instructions, that I will be able to run locally and reproduce the issue.

Kind regards,