Add extra headers option to webContents.loadUrl
This commit is contained in:
parent
65ece4b1ca
commit
b29a8c94b9
2 changed files with 5 additions and 0 deletions
|
@ -618,6 +618,10 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
|
||||||
if (options.Get("userAgent", &user_agent))
|
if (options.Get("userAgent", &user_agent))
|
||||||
SetUserAgent(user_agent);
|
SetUserAgent(user_agent);
|
||||||
|
|
||||||
|
std::string extra_headers;
|
||||||
|
if (options.Get("extraHeaders", &extra_headers))
|
||||||
|
params.extra_headers = extra_headers;
|
||||||
|
|
||||||
params.transition_type = ui::PAGE_TRANSITION_TYPED;
|
params.transition_type = ui::PAGE_TRANSITION_TYPED;
|
||||||
params.should_clear_history_list = true;
|
params.should_clear_history_list = true;
|
||||||
params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;
|
params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;
|
||||||
|
|
|
@ -183,6 +183,7 @@ See [session documentation](session.md) for this object's methods.
|
||||||
* `options` Object (optional), properties:
|
* `options` Object (optional), properties:
|
||||||
* `httpReferrer` String - A HTTP Referrer url.
|
* `httpReferrer` String - A HTTP Referrer url.
|
||||||
* `userAgent` String - A user agent originating the request.
|
* `userAgent` String - A user agent originating the request.
|
||||||
|
* `extraHeaders` String - Extra headers separated by "\n"
|
||||||
|
|
||||||
Loads the `url` in the window, the `url` must contain the protocol prefix,
|
Loads the `url` in the window, the `url` must contain the protocol prefix,
|
||||||
e.g. the `http://` or `file://`.
|
e.g. the `http://` or `file://`.
|
||||||
|
|
Loading…
Reference in a new issue