Add support for chrome.extension API in devtools extension.
This commit is contained in:
parent
39b98b0e4d
commit
8051ad8b2a
5 changed files with 19 additions and 1 deletions
10
atom/renderer/lib/chrome-api.coffee
Normal file
10
atom/renderer/lib/chrome-api.coffee
Normal file
|
@ -0,0 +1,10 @@
|
|||
url = require 'url'
|
||||
|
||||
chrome = window.chrome = window.chrome || {}
|
||||
chrome.extension =
|
||||
getURL: (path) ->
|
||||
url.format
|
||||
protocol: location.protocol
|
||||
slashes: true
|
||||
hostname: location.hostname
|
||||
pathname: path
|
|
@ -46,6 +46,9 @@ else
|
|||
if location.protocol is 'chrome-devtools:'
|
||||
# Override some inspector APIs.
|
||||
require path.join(__dirname, 'inspector')
|
||||
else if location.protocol is 'chrome-extension:'
|
||||
# Add implementations of chrome API.
|
||||
require path.join(__dirname, 'chrome-api')
|
||||
else
|
||||
# Override default web functions.
|
||||
require path.join(__dirname, 'override')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue