This commit is contained in:
Jessica Lord 2016-06-08 14:57:20 -07:00 committed by Kevin Sawicki
parent 9f64c39f8c
commit 0ed10658a3
4 changed files with 15 additions and 2 deletions

View file

@ -865,6 +865,7 @@ describe('browser-window module', function () {
ipcMain.once('answer', function (event, message) { ipcMain.once('answer', function (event, message) {
assert.equal(message.runtimeId, 'foo') assert.equal(message.runtimeId, 'foo')
assert.equal(message.tabId, w.webContents.id) assert.equal(message.tabId, w.webContents.id)
assert.equal(message.i18nString, 'foo - bar (baz)')
done() done()
}) })
}) })

View file

@ -0,0 +1,10 @@
{
"foo": {
"message": "foo - $BAZ$ ($2)",
"placeholders": {
"baz": {
"content": "$1"
}
}
}
}

View file

@ -6,7 +6,8 @@
<script> <script>
var message = JSON.stringify({ var message = JSON.stringify({
runtimeId: chrome.runtime.id, runtimeId: chrome.runtime.id,
tabId: chrome.devtools.inspectedWindow.tabId tabId: chrome.devtools.inspectedWindow.tabId,
i18nString: chrome.i18n.getMessage('foo', ['bar', 'baz'])
}) })
var sendMessage = `require('electron').ipcRenderer.send('answer', ${message})` var sendMessage = `require('electron').ipcRenderer.send('answer', ${message})`
window.chrome.devtools.inspectedWindow.eval(sendMessage, function () {}) window.chrome.devtools.inspectedWindow.eval(sendMessage, function () {})

View file

@ -1,5 +1,6 @@
{ {
"name": "foo", "name": "foo",
"version": "1.0", "version": "1.0",
"devtools_page": "foo.html" "devtools_page": "foo.html",
"default_locale": "en"
} }