Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome 已经原生支持截图功能,还可以给节点截图! #125

Closed
islishude opened this issue Oct 19, 2017 · 8 comments
Closed

Comments

@islishude
Copy link
Owner

islishude commented Oct 19, 2017

昨天Chrome62稳定版释出,除了常规修复各种安全问题外,还增加很多功能上的支持,比如说今天要介绍的强大的截图功能。

直接截图

打开开发者工具页面,选择左上角的元素选择按钮(Inspect)

image

Windows 下按住 Ctrl,Mac 就按住 Command,然后在页面拖动选择区域即可。

image

Chrome会自动使用下载方式进行存储,如下效果图,感觉还不错。

image

给节点截图

比如说我们刚才手动截取的区域其实是一个Node节点,如果想完整截取这一部分,我们就需要使用节点截图功能。

image

首先在开发者工具里面选择节点,这个如上图所示直接点选HTML即可。

然后按下快捷键 Ctrl + Shift + p 打开命令工具,Mac下就是 Cmd + Shift + p,输入 node 选择 Capture node screenshot 即可。图片会自动下载。

image

那么我们真的不需要网页截图插件了,如果想截图整个网页,我们直接在根节点选取就可以了。

是不是很方便?

原文首发在我的 GitHub 博客

@ChenHongLuan
Copy link

6666,很好很强大

@islishude islishude removed the 前端 label Apr 5, 2018
@tonitrnel
Copy link

666666,学习了

@greatghoul
Copy link

才知道还能这样,学习了。

@BleemIs42
Copy link

发现节点截屏出来的图片颜色失真很厉害, 有解决办法么?

@greatghoul
Copy link

这个可能不好解决。

@BeliefRC
Copy link

有提供api,通过代码的方式截图吗?

@Hugo-mcx
Copy link

同问,有提供api,通过代码的方式截图吗?最近很需要实现这个功能......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants