gpt4 book ai didi

javascript - Chrome "Copy image"选项在右键单击上下文菜单中显示为灰色

转载 作者:太空宇宙 更新时间:2023-11-04 15:17:09 27 4
gpt4 key购买 nike

在浏览 Apple's Website 时使用 Chrome (23),我发现“复制图像”上下文菜单项被禁用(见屏幕截图)。所以看起来 Webkit 有一种禁用此选项的新方法。有人知道这是什么吗?

Screenshot of disabled 'Copy image' context menu item

最佳答案

图像具有 content: -webkit-image-set 的内联样式。当我删除它时,“复制图像”选项将被启用。

代码(为了便于阅读而缩短):

<img style="content:-webkit-image-set(url(http://store.storeimages.cdn-apple.com), 1, url(http://store.storeimages.cdn-apple.com/), 2);" 
src="http://store.storeimages.cdn-apple.com/">

The idea behind the feature is to allow authors to provide multiple variants of the same image at differing resolutions, and to allow the User Agent to choose the resource that is most appropriate at the time.

http://trac.webkit.org/changeset/111637

另见:http://www.brucelawson.co.uk/2012/html5-urgently-needs-adaptive-images-mechanism/

请注意,无法右键单击和复制图像似乎只是样式的副作用,而不是反下载机制。

关于javascript - Chrome "Copy image"选项在右键单击上下文菜单中显示为灰色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14125086/

27 4 0