]> khamidou — GitHub mirrors - electron.git/commitdiff
Add "frameName" as paramter for "new-window" event
authorCheng Zhao <zcbenz@gmail.com>
Mon, 27 Oct 2014 11:14:17 +0000 (19:14 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 27 Oct 2014 11:14:57 +0000 (19:14 +0800)
atom/browser/api/atom_api_web_contents.cc
atom/browser/api/lib/web-contents.coffee
atom/renderer/lib/guest-view-internal.coffee
atom/renderer/lib/override.coffee
docs/api/web-view-tag.md

index 5487234eb14b98dfd31d1b2c7b3fca3bbde4f859..87cec5d588093f3507032d519c58398d9be26809 100644 (file)
@@ -88,7 +88,7 @@ bool WebContents::ShouldCreateWebContents(
     content::SessionStorageNamespace* session_storage_namespace) {
   base::ListValue args;
   args.AppendString(target_url.spec());
-  args.AppendString(partition_id);
+  args.AppendString(frame_name);
   Emit("new-window", args);
   return false;
 }
index 8ddcf361eb6c7295b18d5848d314c0e1e88b3f20..f27a0689ac7a2a1ba887392beb6b16f3a5c7773f 100644 (file)
@@ -3,8 +3,8 @@ binding = process.atomBinding 'web_contents'
 ipc = require 'ipc'
 
 # Routed window.open messages.
-ipc.on 'ATOM_SHELL_WEB_CONTENTS_WINDOW_OPEN', (event, url, name, features) ->
-  event.sender.emit 'new-window', url, name, features
+ipc.on 'ATOM_SHELL_WEB_CONTENTS_WINDOW_OPEN', (event, args...) ->
+  event.sender.emit 'new-window', event, args...
 
 module.exports.wrap = (webContents) ->
   return null unless webContents.isAlive()
index 24a57ea1faf8ab41ea068218e07bf876923f716f..e5e64d0a80662641b23791e9aa39d2c87f02498f 100644 (file)
@@ -10,7 +10,7 @@ WEB_VIEW_EVENTS =
   'did-stop-loading': []
   'did-get-redirect-request': ['oldUrl', 'newUrl', 'isMainFrame']
   'console-message': ['level', 'message', 'line', 'sourceId']
-  'new-window': ['url', 'partitionId']
+  'new-window': ['url', 'frameName']
   'close': []
   'crashed': []
   'destroyed': []
index e876e10bacee61ee7657c96e830a362fbe677cb8..9ea9f0c8870270377687c6bb410352a536659f1d 100644 (file)
@@ -2,13 +2,13 @@ process = global.process
 ipc = require 'ipc'
 remote = require 'remote'
 
-if process.guestInstanceId?
+unless process.guestInstanceId?
   # Override default window.close.
   window.close = ->
     remote.getCurrentWindow().close()
 
 # Make the browser window or guest view emit "new-window" event.
-window.open = (url, name='', features='') ->
+window.open = (url, frameName='', features='') ->
   options = {}
   for feature in features.split ','
     [name, value] = feature.split '='
@@ -25,7 +25,7 @@ window.open = (url, name='', features='') ->
   options.width ?= 800
   options.height ?= 600
 
-  ipc.send 'ATOM_SHELL_WEB_CONTENTS_WINDOW_OPEN', url, name, features
+  ipc.send 'ATOM_SHELL_WEB_CONTENTS_WINDOW_OPEN', url, frameName, options
 
 # Use the dialog API to implement alert().
 window.alert = (message, title='') ->
index a7b908dee978c9f2906e79c084123729e758e4f3..dc4859fee46657e5305495195a81b86275ce30d1 100644 (file)
@@ -237,7 +237,7 @@ webview.addEventListener('console-message', function(e) {
 ### new-window
 
 * `url` String
-* `partitionId` String
+* `frameName` String
 
 Fired when the guest page attempts to open a new browser window.