關於 jquery-latest.js...

jQuery 官方希望大家不要再使用 jquery-latest.js 了:「Don’t Use jquery-latest.js」。

由於他們發現有大量的網站使用 jquery-latest.js,如果直接照著字面上的意思升級到 2.0,會造成這些網站在 IE{6,7,8} 上爛掉:

To mitigate the risk of “breaking the web”, the jQuery team decided back in 2013 that jquery-latest.js could not be upgraded to the 2.0 branch even though that is technically the latest version. There would just be too many sites that would mysteriously stop working with older versions of Internet Explorer, and many of those sites may not be maintained today.

所以官方已經決定將這個檔案鎖定在 1.11.1 版:

As jQuery adoption has continued to grow, even that safeguard seems insufficient to protect against careless use of http://code.jquery.com/jquery-latest.js. So we have decided to stop updating this file, as well as the minified copy, keeping both files at version 1.11.1 forever. The latest released version is always available through either the jQuery core download page or the CDN home page. Developers can download the latest version from one of those pages or reference it in a script tag directly from the jQuery CDN by version number.

同時,這個決策得到 Google CDN team 的支持,所以 Google CDN 上的 http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js 也將鎖在 1.11.1:

The Google CDN team has joined us in this effort to prevent inadvertent web breakage and no longer updates the file at http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js. That file will stay locked at version 1.11.1 as well. However, note that this file currently has a very short cache time, which means you’re losing the performance benefit of of a long cache time that the CDN provides when you request a full version like 1.11.1 instead.

同時官方也再三宣導,請不要用 jquery-latest.js 了,應該在使用時指定版本號碼。

這個決策算是一種 workaround,避免全世界一堆網站爛掉...

最佳化 nginx 的 TLS Time to First Byte (TTTFB)

在「Optimizing NGINX TLS Time To First Byte (TTTFB)」這篇文章裡在討論要如何讓 nginx 的 TLS Time to First Byte (TTTFB) 盡可能短。

可以看到文章裡面用到兩個方法,一個是修改 nginx 的程式碼縮小 TLS record size。我對是覺得頗危險,尤其是作者的改法不知道有什麼 side-effect... (要注意 nginx 裡面直接拿 NGX_SSL_BUFSIZEBIO_set_write_buffer_size 使用,這代表有可能還有其他的地方也是這樣搞?)

第二個方法是開啟 TLS False Start,目前主流的瀏覽器都陸陸續續支援了。

這是文章作者的測試:

可以看到時間減少的相當多。

現在是期望作者這篇文章的測試可以讓 patch 合併回 mainstream 後再用,這樣有比較多人 audit...

微軟試著找 Blogger 寫 IE 相關的文章

微軟透過媒體公司 (或是公關公司) 試著找 Blogger 寫 IE 相關的文章,不過這次找錯人而爆炸了:「Microsoft Paying Bloggers To Write About Internet Explorer」。

Michael ArringtonTechCrunch 的共同創辦人,在公司被 AOL 併購後另外開了自己的 blog 來寫他自己對於科技業的種種看法。

而他的 blog「Uncrunched」的最上方就是:

馬上中大獎...

微軟的 IE6+ 安全性更新

即使 Windows XP 在上個月就已經停止安全性更新,但這次的 CVE-2014-1776 影響層面還是太廣,微軟還是提供 Windows XP 用戶相關的 patch (透過 Windows Update 發送):

Use-after-free vulnerability in VGX.DLL in Microsoft Internet Explorer 6 through 11 allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption) via unspecified vectors, as exploited in the wild in April 2014.

在「Security Update Released to Address Recent Internet Explorer Vulnerability」也可以看到說明。

看到 use-after-free 這個詞就想到 OpenSSL 前陣子也來一發 CVE-2010-5298 (居然是 2010 年的 CVE),讓人... XD

jQuery 多出 1.12 與 1.13 的計畫

jQuery 的「Browser Support in jQuery 1.12 and Beyond」這篇提到新的計畫,其中 What's Changing? 裡提到:

There are no firm dates, but we plan on releasing jQuery core versions 1.12 and 2.2 this year. jQuery 1.13/2.3 will be released some time in 2015.

重點在於對 IE 的支援度。其中 1.12 會繼續支援 IE6+,而 1.13 則放棄 IE{6,7},只支援 IE8+:

jQuery 1.12: This will be the last release to support Internet Explorer 6 and 7. As of today, no feature requests or bug fixes will be landed for them. Only serious regressions for these browsers will be fixed in patch releases (e.g., 1.12.1). jQuery 1.13 will support IE8 as its minimum browser.

這件事情總算是發生了,也就是多出一個「支援 IE8+」的版本。這也就是兩年前我在「jQuery 2.0 將放棄 IE{6,7,8} 的事情...」抱怨過的事情,我無法想像在 John Resig 當政的年代會直接規劃出不支援 IE{6,7,8} 的產品。

現在的 jQuery 有種 AWK 的感覺。

剛好也是提到 jQuery,前陣子「The reason Angular JS will fail」這篇也是讓我笑得很開心,也許有機會再寫...

擋 Open Redirect 的問題...

Open Redirect 的問題可以參考:

這兩個連結。主要是要避免 phishing 的問題上。

一開始是以「只允許 / 開頭」為條件過濾,但 protocol-relative 的 //www.example.com 可以繞開。

如果變成「只允許 / 開頭,但不允許 // 開頭」,是不是就沒事了呢?

在「Evolution of Open Redirect Vulnerability.」這邊又看到新招:「/\www.example.com」。

想要用 parse_url() 檢查?沒問題:

$ php -a
Interactive mode enabled

php > var_dump(parse_url("/\\www.example.com"));
array(1) {
  'path' =>
  string(17) "/\www.example.com"
}

但實際測試會發現 IE8 與 Google Chrome 都會跳到 www.example.com (沃槽),其他瀏覽器就先不測了 ~_~

不過原文說的 ///www.example.comPHP 上測試應該是不會過的?

$ php -a
Interactive mode enabled

php > var_dump(parse_url("///www.example.com"));
bool(false)

反正又冒出一堆問題要處理了 ~_~

原來 Adblock Plus 有 IE 版了...

在「Year 2013 in retrospect」這邊看 Adblock Plus 官方回顧 2013 年時才發現原來有 IE 版了:「Adblock Plus - Surf the web without annoying ads!」。

繁體中文版的預設值跟其他平台相同,都是 ChinaList+EasyList (完整的列表可以參考「已知的 Adblock Plus 過濾條件集」):

這是安裝後「Yahoo奇摩」首頁的樣子:

晚點來幫老人家電腦裝...

Windows XP 上的瀏覽器...

微軟對 Windows XP 的支援到 2014 年 4 月 8 日:


出自「Support is ending for Windows XP - Microsoft Windows

Google Chrome 也宣佈只支援到 2015 年 4 月 (晚一年):「Extending Chrome support for XP users until April 2015」。

目前 Mozilla 還沒說什麼,不過應該也不會比 Google Chrome 長太久吧,畢竟 Windows 7 的市占率一直在提昇...

Google Apps 停止支援 IE9

Google Apps 宣佈停止支援 IE9:「End of support for Internet Explorer 9」。

IE9 是個很特別的版本,他並不是任何一個 Microsoft Windows 的內建瀏覽器,只支援 Windows Vista 以及之後的版本,所以 Windows XP 能用到最新的 IE 瀏覽器是 IE8。

基於這樣的理由,會使用 IE9 的人都是另外再安裝的,算是比較進階的使用者。對於這些使用者,要他們升級到 IE10+ 或是其他瀏覽器應該不是太大的問題,所以 Google Apps 這麼快就不支援 IE9 也是愈其中的事情了 :p

SNI 支援 (單一 IP 多個 SSL Certificate)

Twitter 上看到 yllan 提到 SSL certificate 的問題:

這是看 client 對 Server Name Indication 的支援程度而決定的。

在維基百科說明中「Browsers with support for TLS server name indication」這段裡面列出來的瀏覽器,可以看出來其實最大的問題就是 Windows XP 上的 IE{6,7,8} 不支援。(但 Windows Vista 以及 Windows 7 的 IE{7,8} 支援 SNI)

手上一時間找不到 Windows XP + IE{6,7,8} 的數量,但 gs.statcounter.com 上有幾個數字可以參考。

首先是台灣 IE8 的用戶數量:

再來是 Windows XP 數量:

以這兩個圖的資料來看,還是不太能用啊... :o