Skip to content

Commit

Permalink
ensuring single instance for loading and unloading extension
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 committed Jan 9, 2015
1 parent b83f042 commit c0f0f4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions atom/browser/lib/chrome-extension.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ getExtensionInfoFromPath = (srcDirectory) ->
startPage: page
name: manifest.name
srcDirectory: srcDirectory
extensionInfoMap[manifest.name]
extensionInfoMap[manifest.name]

# Load persistented extensions.
loadedExtensionsPath = path.join app.getDataPath(), 'DevTools Extensions'
Expand Down Expand Up @@ -74,8 +74,9 @@ app.once 'ready', ->

BrowserWindow.addDevToolsExtension = (srcDirectory) ->
extensionInfo = getExtensionInfoFromPath srcDirectory
window._loadDevToolsExtensions [extensionInfo] for window in BrowserWindow.getAllWindows()
extensionInfo.name
if extensionInfo
window._loadDevToolsExtensions [extensionInfo] for window in BrowserWindow.getAllWindows()
extensionInfo.name

BrowserWindow.removeDevToolsExtension = (name) ->
delete extensionInfoMap[name]
Expand Down

0 comments on commit c0f0f4c

Please sign in to comment.