Merge pull request #1883 from atom/http-referer-doc

📝 Add missing `httpreferer` option doc.
This commit is contained in:
Cheng Zhao 2015-06-09 11:15:44 +08:00
commit 24586c1330
4 changed files with 12 additions and 9 deletions

View file

@ -430,12 +430,12 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
content::NavigationController::LoadURLParams params(url);
GURL http_referrer;
if (options.Get("httpreferrer", &http_referrer))
if (options.Get("httpReferrer", &http_referrer))
params.referrer = content::Referrer(http_referrer.GetAsReferrer(),
blink::WebReferrerPolicyDefault);
std::string user_agent;
if (options.Get("useragent", &user_agent))
if (options.Get("userAgent", &user_agent))
SetUserAgent(user_agent);
params.transition_type = ui::PAGE_TRANSITION_TYPED;

View file

@ -68,8 +68,8 @@ createGuest = (embedder, params) ->
if params.src
opts = {}
opts.httpreferrer = params.httpreferrer if params.httpreferrer
opts.useragent = params.useragent if params.useragent
opts.httpReferrer = params.httpreferrer if params.httpreferrer
opts.userAgent = params.useragent if params.useragent
@loadUrl params.src, opts
if params.allowtransparency?

View file

@ -171,10 +171,10 @@ class SrcAttribute extends WebViewAttribute
# Navigate to |this.src|.
opts = {}
httpreferrer = @webViewImpl.attributes[webViewConstants.ATTRIBUTE_HTTPREFERRER].getValue()
if httpreferrer then opts.httpreferrer = httpreferrer
if httpreferrer then opts.httpReferrer = httpreferrer
useragent = @webViewImpl.attributes[webViewConstants.ATTRIBUTE_USERAGENT].getValue()
if useragent then opts.useragent = useragent
if useragent then opts.userAgent = useragent
guestContents = remote.getGuestWebContents(@webViewImpl.guestInstanceId)
guestContents.loadUrl @getValue(), opts

View file

@ -571,9 +571,9 @@ Calling `window.print()` in web page is equivalent to call
doesn't need print feature, you can safely remove `pdf.dll` in saving binary
size.
### BrowserWindow.loadUrl(url)
### BrowserWindow.loadUrl(url, [options])
Same with `webContents.loadUrl(url)`.
Same with `webContents.loadUrl(url, [options])`.
### BrowserWindow.reload()
@ -778,9 +778,12 @@ Emitted when a plugin process is crashed.
Emitted when the WebContents is destroyed.
### WebContents.loadUrl(url)
### WebContents.loadUrl(url, [options])
* `url` URL
* `options` URL
* `httpReferrer` String - A HTTP Referer url
* `userAgent` String - A user agent originating the request
Loads the `url` in the window, the `url` must contains the protocol prefix,
e.g. the `http://` or `file://`.