-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Minor fixes.
- Loading branch information
Showing
25 changed files
with
871 additions
and
956 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,45 @@ | ||
import BasicAdapter from "./basic"; | ||
var Ember = window.Ember; | ||
const Ember = window.Ember; | ||
const { computed, run } = Ember; | ||
|
||
var ChromeAdapter = BasicAdapter.extend({ | ||
connect: function() { | ||
var channel = this.get('_channel'); | ||
var self = this; | ||
return this._super.apply(this, arguments).then(function() { | ||
export default BasicAdapter.extend({ | ||
connect() { | ||
const channel = this.get('_channel'); | ||
return this._super(...arguments).then(() => { | ||
window.postMessage('debugger-client', [channel.port2], '*'); | ||
self._listen(); | ||
this._listen(); | ||
}, null, 'ember-inspector'); | ||
}, | ||
|
||
sendMessage: function(options) { | ||
sendMessage(options) { | ||
options = options || {}; | ||
this.get('_chromePort').postMessage(options); | ||
}, | ||
|
||
inspectElement: function(elem) { | ||
inspectElement(elem) { | ||
/* globals inspect */ | ||
inspect(elem); | ||
}, | ||
|
||
_channel: Ember.computed(function() { | ||
_channel: computed(function() { | ||
return new MessageChannel(); | ||
}).property().readOnly(), | ||
}).readOnly(), | ||
|
||
_chromePort: Ember.computed(function() { | ||
_chromePort: computed(function() { | ||
return this.get('_channel.port1'); | ||
}).property().readOnly(), | ||
}).readOnly(), | ||
|
||
_listen: function() { | ||
var self = this, | ||
chromePort = this.get('_chromePort'); | ||
_listen() { | ||
let chromePort = this.get('_chromePort'); | ||
|
||
chromePort.addEventListener('message', function(event) { | ||
var message = event.data; | ||
Ember.run(function() { | ||
self._messageReceived(message); | ||
const message = event.data; | ||
run(() => { | ||
this._messageReceived(message); | ||
}); | ||
}); | ||
|
||
chromePort.start(); | ||
|
||
} | ||
}); | ||
|
||
export default ChromeAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.