safari

在CSS中按数据属性选择元素

喜夏-厌秋 提交于 2020-02-26 06:21:30
是否可以通过CSS5的HTML5数据属性(例如 data-role )选择元素? #1楼 在现代浏览器中,还可以选择属性而不管其内容如何 与: [data-my-attribute] { /* Styles */ } [anything] { /* Styles */ } 例如: http : //codepen.io/jasonm23/pen/fADnu 在相当大比例的浏览器上运行。 注意,这也可以在JQuery选择器中使用,也可以使用 document.querySelector #2楼 值得注意的是CSS3子串属性选择器 [attribute^=value] { /* starts with selector */ /* Styles */ } [attribute$=value] { /* ends with selector */ /* Styles */ } [attribute*=value] { /* contains selector */ /* Styles */ } #3楼 您可以组合多个选择器,这很酷,您可以根据其值选择每个属性和属性,例如仅基于CSS的值基于 href 来选择。 通过属性选择器,您可以使用 id 和 class 属性玩一些额外的游戏 这是关于“ 属性选择器” 的精彩阅读 小提琴 a[href="http://aamirshahzad.net

全面封杀?超过13个月的HTTPS证书将被Safari拒绝!

耗尽温柔 提交于 2020-02-26 04:46:56
上周(当地时间2月19日),在斯洛伐克举行的CA/浏览器(CA / Browser)论坛会议上, 苹果公司宣布:为了提高网络安全性,从 2020年9月1日开始,任何有效期超过 398 天的新网站证书将不会受到Safari浏览器的信任,而是会被拒绝。另外,在截止日期(2020年9月1日)之前颁发的较旧证书不受此规则的影响。 这项政策的发布意味着使用在截止时间点之后使用两年期SSL/TLS证书的网站将在苹果系统的浏览器中引发隐私错误,所有证书需要每年进行续签,以保持Safari的信任。( 注意: 2020年9月1日前签发的所有SSL/TLS证书不受此政策影响 ) 苹果发布这项政策的目的是通过确保开发者使用最新加密标准的证书来提高网站的安全性,并减少被忽视的旧证书的数量,这些证书有可能被盗窃,并被用于网络钓鱼和驱动器恶意软件攻击。如果研究人员或不法分子能够破解SSL/ TLS标准中的密码,短期证书将确保人们在大约一年内迁移到更安全的证书。 浏览器巨头正逐步缩短证书有效期 2019年8月,谷歌在CA/Browser Forum 会议上就提出将 HTTPS 证书的有效期从 27 个月缩短到 13 个月的议案,最终,CA/Browser Forum 经投票否决了这项提案,SSL证书最长有效期仍为 2年 。 据悉,苹果,谷歌和CA/Browser的其他成员考虑缩短证书有效期的问题已有一段时间

用Python下载文件

生来就可爱ヽ(ⅴ<●) 提交于 2020-02-26 03:28:02
前提条件 需要事先安装 requests 模块: pip install requests 放码过来 import requests url = 'XXX' #文件下载来源URL filename = '' #下载到本地后新文件名 r = requests.get(url) with open(filename, "wb") as code: code.write(r.content) 实战演习 从目标URL 大电影双语阅读.星际穿越 Interstellar (赠英文音频与单词随身查APP) 下载音频文件。 通过浏览器后台分析,可找到音频的URL。 其实通过浏览器自带下载功能,应该很容易下载到本地。 但是,屡试不行。 于是,寻思着,同一浏览器,同样请求URL,为何却得不到想要的结果? 尝试在地址栏输入音频的URL。 Access Denied, You are denied by bucket referer policy. 看到被拒的信息后,联想到会不会是 请求头 的缘故呢? 于是,浏览器后台查找音频URL的请求头。 有可能是下载器发出请求时没要带上 Referer 等参数而被拒绝连接。 是时候发挥Python的强大功力了,在请求下载时请求头带上 Referer 等参数。 headers={ "Referer": "http://www.ecustpress.cn

Outline for Mac(Mac记事本软件) v3.22.0中文版

我是研究僧i 提交于 2020-02-25 19:49:49
Outline for mac激活版 是Mac os平台上的一款非常好用的Mac记事本软件,Outline for mac是与 Microsoft OneNote 文件格式完全兼容,并支持与微软 SkyDrive 同步。这允许您将您的笔记和 Windows PC 和其他设备与安装 OneNote 同步。更多Mac软件获取,来 Mac软件下载平台Macdown 探索一番吧! Outline for Mac破解版下载 https://www.macdown.com/mac/6627.html Outline for Mac官方介绍 Outline Mac是一款笔记本软件,其结构类似于真正的纸质书籍:笔记本,部分,部分和页面组有助于在笔记中保持顺序,无论其复杂程度如何。适用于Mac的大纲非常适合学生,教师,医生,律师,管理人员以及日常生活中涉及各种记录的每个人。它可以与Outline for iPad和Microsoft OneNote结合使用,这使得笔记可以同多平台互动分享。 Outline for Mac功能介绍 创意经理 使用Outline记笔记包含最佳的OS X和应用程序功能。使用Outline创建,组织,存储和编辑笔记就像使用真正的纸质笔记本一样简单。大纲结构灵活。它遵循并反映了您的想法发展的方式。 安全的数据存储 “大纲”中的注释安全可靠。应用的更改会定期记录并可离线使用

选择元素中的文本(类似于用鼠标突出显示)

时光怂恿深爱的人放手 提交于 2020-02-25 18:42:46
我想让用户单击一个链接,然后它在另一个元素( 而不是 输入)中选择HTML文本。 “选择”是指您将鼠标拖到文本上方来选择文本的方式。 这一直是研究的负担,因为每个人都用其他术语谈论“选择”或“突出显示”。 这可能吗? 到目前为止,我的代码: HTML: <a href="javascript:" onclick="SelectText('xhtml-code')">Select Code</a> <code id="xhtml-code">Some Code here </code> JS: function SelectText(element) { $("#" + element).select(); } 我是否明显遗漏了一些东西? #1楼 将 jQuery.browser.webkit 添加到Chrome的“其他”。 无法在Chrome 23中正常运行。 在下面制作此脚本以选择 <pre> 标记中具有 class="code" 。 jQuery( document ).ready(function() { jQuery('pre.code').attr('title', 'Click to select all'); jQuery( '#divFoo' ).click( function() { var refNode = jQuery( this )[0]; if (

Video autoPlay is not working chrome and safari?

孤街醉人 提交于 2020-02-25 06:08:40
问题 I want to make the video autoplay without any user gesture in reactjs. I know as per recent google and apple web video policy we cannot autoplay a video having audio without user gesture.But i have seen few websites which still autoplays the video across modern web browsers also. I came across many questions related to this issue on stackoverflow but none helped me. Here is what i have tried. Try 1. <video id="miniVideo" preLoad="yes" autoPlay="autoplay" loop width="100%" height="auto"

Safari not sending cookie even after setting SameSite=None; Secure

Deadly 提交于 2020-02-21 11:19:20
问题 Our application uses cookies to remember user login. Every auth API call we make, the browser attaches server-set HTTPonly cookie with the API request and gets authenticated. This behaviour seems to be broken in safari after Mojave release. I read about the cross-site cookie security implemented by safari and our server team added SameSite=None;Secure while setting the cookie. Even after that, it still doesn't work. Set-Cookie: my_cookie=XXXXX; path=/; secure; HttpOnly; SameSite=None Please

Safari not sending cookie even after setting SameSite=None; Secure

寵の児 提交于 2020-02-21 11:14:03
问题 Our application uses cookies to remember user login. Every auth API call we make, the browser attaches server-set HTTPonly cookie with the API request and gets authenticated. This behaviour seems to be broken in safari after Mojave release. I read about the cross-site cookie security implemented by safari and our server team added SameSite=None;Secure while setting the cookie. Even after that, it still doesn't work. Set-Cookie: my_cookie=XXXXX; path=/; secure; HttpOnly; SameSite=None Please

作业2,博客1

自作多情 提交于 2020-02-20 08:03:35
scrapy框架下实现爬虫douluo的useragent的随机更换功能 爬虫 在频繁访问一个页面时,这个请求头如果一直保持一致,那么有极大可能被服务器发现,从而禁止这个请求头的访问,因此我们要在我们要在访问这个页面之前随机地更换请求头,这样才可以 避免爬虫被抓 。 随机更换请求头,可以在下载中间件中实现,在请求发送给服务器之前,随机的选择一个请求头,这样就可以避免总使用一个请求头,有效的降低了被发现的风险 更换ueragent的方法有多种,这里采用的是学长要求的在middlewares.py中进行更换。代码如下: 1.首先在settings.py中设置用于更换的user-agent,这是我在网上找到的一些user-agent,放入USER_AGENT_LIST中 USER_AGENT_LIST=[ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1", "Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11", "Mozilla/5.0

safari app extension crashes after a few seconds for hello world project

寵の児 提交于 2020-02-20 04:48:51
问题 open xcode file > new >project > Cocoa app file > new > target > safari extension compile and run extension select safari. xcode compiles with no errors. Safari opens for a few seconds then crashes. this is the output of the debug window. 2018-10-10 15:27:18.039905-0700 Safari[1020:16719] [SQLiteStore] Failed to acquire database store coordination lock at /Users//Library/Safari/Favicon Cache/favicons.db-lock: [35: Resource temporarily unavailable] 2018-10-10 15:27:18.040155-0700 Safari[1020