electron/spec/fixtures/devtools-extensions/foo/index.html

29 lines
812 B
HTML
Raw Normal View History

2016-05-17 14:52:45 -07:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
2016-06-09 14:14:20 -07:00
function testStorage (callback) {
chrome.storage.sync.set({foo: 'bar'}, function () {
2016-06-09 16:26:25 -07:00
chrome.storage.sync.get({foo: 'baz'}, callback)
2016-06-09 14:14:20 -07:00
})
}
testStorage(function (items) {
var message = JSON.stringify({
runtimeId: chrome.runtime.id,
tabId: chrome.devtools.inspectedWindow.tabId,
i18nString: chrome.i18n.getMessage('foo', ['bar', 'baz']),
2016-06-09 14:14:20 -07:00
storageItems: items
})
var sendMessage = `require('electron').ipcRenderer.send('answer', ${message})`
window.chrome.devtools.inspectedWindow.eval(sendMessage, function () {})
2016-06-06 14:36:01 -07:00
})
2016-05-17 14:52:45 -07:00
</script>
</head>
<body>
a custom devtools extension
</body>
</html>