Chrome Devtools工作区映射不再有效 [英] Chrome Devtools Workspaces mapping no longer working

查看:656
本文介绍了Chrome Devtools工作区映射不再有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这曾经是一种魅力,过去我已经设置了十几次,使用相同的硬件/软件,但现在它失败了:





必要的编辑权限位于因为我可以在Devtools中编辑文件,如果我直接从源选项卡中的本地工作区打开它,编辑并保存它,但这当然不会比使用任何其他IDE更好,因为我看不到立即坚持我以前的改变:



没有LESS / SASS / Taskrunner的聪明在这里,只是普通的CSS文件。



我有looke d在Sawbuck,Devtools在Devtools上,并且看不到任何错误。



我已经完全禁用了防火墙。

我正在使用Windows 7,Chrome 56(并尝试使用Canary,也是58),并且服务器的文件系统作为网络驱动器安装在Z:上。



稍微奇怪的是,在建立资源链接后,工作区映射似乎将文件视为目录,方法是右键单击远程资源并选择映射到文件系统资源...或本地资源并选择映射到网络资源...,但这可能一直是这种情况,我从来没有注意到 - 无论如何,我也手动添加了父目录和网站根目录的映射,但是结果是一样的;没有持续的编辑。





我通常太自豪地问一个关于这样的问题,并花了很多时间试图自己弄清楚,但我觉得我现在打砖墙太久了。我会很感激任何指针,如果你有类似的经验。

解决方案

它似乎是由缓存破坏查询字符串WordPress添加 -

您可以在我的屏幕截图中看到它:?ver = 4.7.2 相关的铬错误报告。



现在,在WordPress中为 functions.php 添加这个命令以删除缓存清除后缀允许我重新启用persistent编辑:

 函数fj_remove_version($ url){
return remove_query_arg('ver',$ url);
}

add_filter('style_loader_src','fj_remove_version');

未来,它看起来像 Persistence 2.0 错误报告将成为解决方案。现在可以作为Chrome DevTool实验启用


This used to work a charm, and I've set up probably a dozen times in the past, using the same hardware / software, but now it fails:

The necessary permissions to edit are in place, because I can edit the file within Devtools, if I open it directly from the local workspace in the sources tab, edit and save it, but this of course is no better than using any other IDE, since I can't see and immediately persist my changes like I used to:

No LESS / SASS / Taskrunner cleverness here, just plain CSS files.

I've looked at Sawbuck, Devtools on Devtools, and see no errors.

I've completely disabled the firewall.

I'm using Windows 7, Chrome 56 (and tried Canary, 58, too), and the server's file system is mounted as a network drive, on Z:.

The one slightly odd thing is how the workspace mapping seems to treat the files as directories after I establish the link of a resource, by either right clicking the remote resource and choosing "Map to file system resource..." or a local resource and choosing "Map to network resource...", but this may always have been the case, and I never noticed- in any case, I've also manually added a mapping of the parent directory, and the site's root directory, but the outcome is the same; no persistent edits.

I'm usually too proud to ask a question about something like this, and spend ages trying to figure it out on my own, but I feel like I'm hitting a brick wall for too long now. I'd be grateful for any pointers, if you've had a similar experience.

解决方案

It seems to be down to the cache-busting query string which WordPress adds-

You can see it in my screenshot: ?ver=4.7.2

clearly I must have only used this DevTools Workspace feature before integration into Wordpress. Here is a relevant Chromium bug report.

For now, adding this to functions.php in WordPress in order to remove the cache-busting suffix allows me re-enable persistent edits:

function fj_remove_version( $url ) {
    return remove_query_arg( 'ver', $url );
}

add_filter( 'style_loader_src', 'fj_remove_version' );

In future, it looks like Persistence 2.0, recommended at the end of the bug report, will be the solution. It can be enabled as a Chrome DevTool experiment now.

这篇关于Chrome Devtools工作区映射不再有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆