简体   繁体   English

DevTools 解析 SourceMap 失败:chrome-extension

[英]DevTools failed to parse SourceMap: chrome-extension

A week ago i think, I started getting warning messages in my google chrome console.我想一周前,我开始在我的 google chrome 控制台中收到警告消息。

消息 Clearing cache doesn't change anything, the messages disappear only in incognito mode.清除缓存不会改变任何东西,消息只会在隐身模式下消失。

Any ideas how to get rid of these warnings ?任何想法如何摆脱这些警告?

I had this problem with the LastPass browser extension.我在使用LastPass浏览器扩展时遇到了这个问题。 I proved my theory by disabling LastPass and reloading the site in question - the warnings were gone!我通过禁用LastPass并重新加载有问题的站点来证明我的理论 - 警告消失了!

I really didn't want to disable the JavaScript and CSS source maps so I have made the following change below:我真的不想禁用 JavaScript 和 CSS 源映射,所以我做了以下更改:

Pending an update from the LastPass that addresses the issue, I have temporarily fixed this by changing one of the settings in the Extension settings for LastPass.在 LastPass 更新解决该问题之前,我已通过更改 LastPass 的扩展设置中的一项设置来临时解决此问题。

I had this setting previously set to On all sites , which was injecting the LastPass code on all sites blindly.我之前将此设置设置为On all sites ,这是盲目地在所有网站上注入 LastPass 代码。 With this change you need to right click on the Username/Password box to enable last pass, but on the plus side there are no warnings in the console anymore.进行此更改后,您需要右键单击“用户名/密码”框以启用最后一次通过,但从好的方面来说,控制台中不再有警告。

I consider this a temporary workaround until either Google or LastPass fix the issue.在 Google 或 LastPass 解决问题之前,我认为这是一个临时解决方法。


EDIT: There is also a checkbox in the settings dialogue for the Console tab itself called Selected context only .编辑:控制台选项卡本身的设置对话框中还有一个复选框,名为Selected context only Ticking this will remove the warnings and errors from Chrome extensions.勾选此项将删除 Chrome 扩展程序中的警告和错误。 Note this setting is not persisted - you'll have to click it each time you open the Dev Tools.请注意,此设置不会保留 - 每次打开开发工具时都必须单击它。

控制台设置面板的屏幕截图

I've just used Chrome Console Filter -chrome-extension .我刚刚使用了 Chrome 控制台过滤器-chrome-extension I see everything except chrome-extension output.我看到了除chrome 扩展输出之外的所有内容。

Chrome 控制台过滤器

对我来说,它是 McAffee Web Advisor Chrome 扩展程序 - 已删除并且消息消失了 :)

this worked for me:这对我有用:

  1. Find the path to the extensions.找到扩展的路径。 Type this in chrome: chrome://version/ .在 chrome 中输入: chrome://version/ 。 Look for the profile path.查找配置文件路径。 this location is where the extensions are saved.此位置是保存扩展的位置。

  2. Open the location with the file explorer.使用文件资源管理器打开该位置。 In my case it was something like (AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions\\hdokiejnpimakedhajhdlcegeplioahd\\4.51.0.1_0) The error was with the last pass plugin.在我的情况下,它类似于 (AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions\\hdokiejnpimakedhajhdlcegeplioahd\\4.51.0.1_0) 错误与最后一次通过插件有关。

  3. Create the missing maps.创建缺失的地图。 In my case it was: sourcemaps/就我而言,它是:sourcemaps/

Note that i only created the empty maps.请注意,我只创建了空地图。

All I did is disable my LastPass extension(plugin), clear browsing data, hard reload the page and it works fine.我所做的只是禁用我的 LastPass 扩展程序(插件),清除浏览数据,重新加载页面,它工作正常。 It might be another plugin for you它可能是你的另一个插件

You need to open settings from the debug console您需要从调试控制台打开设置

在 Chrome 中打开设置控制台

Then you disable one of chrome's option (They added it recently)然后您禁用 chrome 的选项之一(他们最近添加了它)

禁用 Chrome 选项

Just refresh the browser and all ready只需刷新浏览器,一切就绪

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

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