canjs / can-queues

A light weight JavaScript task queue
https://canjs.com/doc/can-queues.html
MIT License
2 stars 2 forks source link

Make it possible to filter stack() #16

Closed phillipskevin closed 6 years ago

phillipskevin commented 6 years ago

Right now queues.stack() returns a lot of data.

Some of this (DOM nodes I think) causes an exception when run in the devtools Chrome extension:

image

I'm still investigating what exactly causes this, but to get around it I'd like to be able to do something like this:

can.queues.stack(function (task) {
    return {
        description: task.meta.stack.name + " ran task:" + task.fn.name
    };
})
justinbmeyer commented 6 years ago

I'm confused by what the problem here would be. This is a problem using postMessage with the stack data or something?

Why would queues.stack() need to provide this? Can the dev tool run arbitrary code in the user realm? Could it do this filtering before transmitting data?

It feels weird to add functionality like this to queues ...