Add "disablewebsecurity" attribute for <webview>
This commit is contained in:
parent
6d168b89ef
commit
c92d2531b5
6 changed files with 11 additions and 2 deletions
|
@ -93,6 +93,7 @@ attachGuest = (embedder, elementInstanceId, guestInstanceId, params) ->
|
|||
webViewManager.addGuest guestInstanceId, elementInstanceId, embedder, guest,
|
||||
nodeIntegration: params.nodeintegration
|
||||
plugins: params.plugins
|
||||
disableWebSecurity: params.disablewebsecurity
|
||||
preloadUrl: params.preload ? ''
|
||||
|
||||
guest.attachParams = params
|
||||
|
|
|
@ -41,7 +41,8 @@ struct Converter<atom::WebViewManager::WebViewOptions> {
|
|||
return false;
|
||||
return options.Get("nodeIntegration", &(out->node_integration)) &&
|
||||
options.Get("plugins", &(out->plugins)) &&
|
||||
options.Get("preloadUrl", &(out->preload_url));
|
||||
options.Get("preloadUrl", &(out->preload_url)) &&
|
||||
options.Get("disableWebSecurity", &(out->disable_web_security));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -63,7 +64,10 @@ void WebViewManager::AddGuest(int guest_instance_id,
|
|||
web_contents_map_[guest_instance_id] = { web_contents, embedder };
|
||||
|
||||
WebViewRendererState::WebViewInfo web_view_info = {
|
||||
guest_instance_id, options.node_integration, options.plugins
|
||||
guest_instance_id,
|
||||
options.node_integration,
|
||||
options.plugins,
|
||||
options.disable_web_security,
|
||||
};
|
||||
net::FileURLToFilePath(options.preload_url, &web_view_info.preload_script);
|
||||
content::BrowserThread::PostTask(
|
||||
|
|
|
@ -24,6 +24,7 @@ class WebViewManager : public content::BrowserPluginGuestManager {
|
|||
struct WebViewOptions {
|
||||
bool node_integration;
|
||||
bool plugins;
|
||||
bool disable_web_security;
|
||||
GURL preload_url;
|
||||
};
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ class WebViewRendererState {
|
|||
int guest_instance_id;
|
||||
bool node_integration;
|
||||
bool plugins;
|
||||
bool disable_web_security;
|
||||
base::FilePath preload_script;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue