简体   繁体   English

如果从Web-worker使用Xdebug不会停止?

[英]Xdebug dont stop if used from web-worker?

Is it possible that Xdebug doesn't stop in breakpoints if requests started from inside a web-worker? 如果请求是从Web工作者内部启动的,Xdebug是否有可能不会在断点处停止? I'm doing a fetch() request. 我正在执行fetch()请求。

fetch(datatable_instance_defaults.pathToSqlFile + 'returnSqlRes.php',
    {
        headers: {
            'Accept': 'text/plain',
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        method: "post",
        body: JSON.stringify(sql)
    })
    .then(function (res) {
        return res.json();
    })

Since the web-worker API has no access to the session storage according to the DedicatedWorkerGlobalScope your Xdebug session cookie can not be passed along to the server, thus it does not recognize your open Xdebug session from the main thread. 由于根据DedicatedWorkerGlobalScope ,Web-Worker API无法访问会话存储,因此您的Xdebug会话Cookie无法传递到服务器,因此它无法从主线程识别您打开的Xdebug会话。

You could temporarily add the XDEBUG_SESSION_START GET parameter to your URL to start a new Xdebug session. 您可以将XDEBUG_SESSION_START GET参数临时添加到URL中,以开始新的Xdebug会话。 (see the documentation of xdebug, too) (也请参阅xdebug 的文档

fetch(datatable_instance_defaults.pathToSqlFile + 'returnSqlRes.php?XDEBUG_SESSION_START=session_name',

It is a little inconvenient to do it this way, but I imagine that the plugin developers need to figure out a way to keep the Xdebug session or restart it for service-worker requests. 用这种方法这样做有点不方便,但是我想插件开发人员需要找到一种方法来保留Xdebug会话或针对服务工作者的请求重新启动它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM