greasemonkey/greasemonkey — Issue #1492: @run-at document-start
Author: 0rt
Created: 2012-01-03 17:15:36+00:00
State: open

run-at document-start is not run soon enough in this script:

```javascript
// ==UserScript==
// @name redirector
// @include /http:\/\/(www\.)?twitter\.com/
// @run-at document-start
// ==/UserScript==
var spec = document.location.href;
window.location = spec.replace(/http/i,"https");
```
This script is for write for redirection twitter in https, because http connection is blocked in China.
Scriptish using run-at document-start can hijack http request and redirect to https connection. But GM can't, it met a reset page (reset by Chinese Firewall)