ember-inspector 4.13.1-alpha.2025.7.9 → 4.13.1-alpha.2025.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/index.html +1 -1
- package/app/styles/app.scss +1 -0
- package/dist/bookmarklet/load_inspector.js +1 -0
- package/dist/bookmarklet/panes-3-16-0/assets/{chunk.524.f09748f2f97c650a11d4.js → chunk.524.8fa2f652e1d638cb866d.js} +4 -4
- package/dist/{firefox/panes-3-16-0/assets/chunk.582.745520fa87699e11d9c5.js → bookmarklet/panes-3-16-0/assets/chunk.582.325d02fae0e9f262a1ae.js} +5 -5
- package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.css +835 -0
- package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.js +42 -4
- package/dist/bookmarklet/panes-3-16-0/assets/vendor.css +0 -836
- package/dist/bookmarklet/panes-3-16-0/assets/vendor.js +3967 -4019
- package/dist/bookmarklet/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
- package/dist/bookmarklet/panes-3-16-0/basic-DfbgtngO.js +144 -0
- package/dist/bookmarklet/panes-3-16-0/basic-debug.js +6 -0
- package/dist/bookmarklet/panes-3-16-0/bookmarklet-debug.js +34 -0
- package/dist/bookmarklet/panes-3-16-0/chrome-debug.js +12 -0
- package/dist/bookmarklet/panes-3-16-0/ember.js +108 -0
- package/dist/bookmarklet/panes-3-16-0/ember_debug.js +22 -10646
- package/dist/bookmarklet/panes-3-16-0/evented-BCTya3yE.js +62 -0
- package/dist/bookmarklet/panes-3-16-0/firefox-debug.js +32 -0
- package/dist/bookmarklet/panes-3-16-0/index.html +3 -3
- package/dist/bookmarklet/panes-3-16-0/internals-CRmXMEzb.js +12 -0
- package/dist/bookmarklet/panes-3-16-0/main.js +7642 -0
- package/dist/bookmarklet/panes-3-16-0/port.js +108 -0
- package/dist/bookmarklet/panes-3-16-0/profile-node.js +60 -0
- package/dist/bookmarklet/panes-3-16-0/promise-assembler.js +218 -0
- package/dist/bookmarklet/panes-3-16-0/runloop-CF-Qpqgy.js +1138 -0
- package/dist/bookmarklet/panes-3-16-0/start-inspector-BPAW_WLv.js +376 -0
- package/dist/bookmarklet/panes-3-16-0/type-check.js +119 -0
- package/dist/bookmarklet/panes-3-16-0/version.js +90 -0
- package/dist/bookmarklet/panes-3-16-0/versions.js +4 -0
- package/dist/bookmarklet/panes-3-16-0/web-extension-C3pMNVSY.js +144 -0
- package/dist/bookmarklet/panes-3-16-0/websocket-debug.js +60 -0
- package/dist/chrome/content-script.js +1 -0
- package/dist/chrome/manifest.json +3 -3
- package/dist/{firefox/panes-3-16-0/assets/chunk.524.f09748f2f97c650a11d4.js → chrome/panes-3-16-0/assets/chunk.524.8fa2f652e1d638cb866d.js} +4 -4
- package/dist/{bookmarklet/panes-3-16-0/assets/chunk.582.745520fa87699e11d9c5.js → chrome/panes-3-16-0/assets/chunk.582.325d02fae0e9f262a1ae.js} +5 -5
- package/dist/chrome/panes-3-16-0/assets/ember-inspector.css +835 -0
- package/dist/chrome/panes-3-16-0/assets/ember-inspector.js +42 -4
- package/dist/chrome/panes-3-16-0/assets/vendor.css +0 -836
- package/dist/chrome/panes-3-16-0/assets/vendor.js +3967 -4019
- package/dist/chrome/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
- package/dist/chrome/panes-3-16-0/basic-DfbgtngO.js +144 -0
- package/dist/chrome/panes-3-16-0/basic-debug.js +6 -0
- package/dist/chrome/panes-3-16-0/bookmarklet-debug.js +34 -0
- package/dist/chrome/panes-3-16-0/chrome-debug.js +12 -0
- package/dist/chrome/panes-3-16-0/ember.js +108 -0
- package/dist/chrome/panes-3-16-0/ember_debug.js +12 -10658
- package/dist/chrome/panes-3-16-0/evented-BCTya3yE.js +62 -0
- package/dist/chrome/panes-3-16-0/firefox-debug.js +32 -0
- package/dist/chrome/panes-3-16-0/index.html +3 -3
- package/dist/chrome/panes-3-16-0/internals-CRmXMEzb.js +12 -0
- package/dist/chrome/panes-3-16-0/main.js +7642 -0
- package/dist/chrome/panes-3-16-0/port.js +108 -0
- package/dist/chrome/panes-3-16-0/profile-node.js +60 -0
- package/dist/chrome/panes-3-16-0/promise-assembler.js +218 -0
- package/dist/chrome/panes-3-16-0/runloop-CF-Qpqgy.js +1138 -0
- package/dist/chrome/panes-3-16-0/start-inspector-BPAW_WLv.js +376 -0
- package/dist/chrome/panes-3-16-0/type-check.js +119 -0
- package/dist/chrome/panes-3-16-0/version.js +90 -0
- package/dist/chrome/panes-3-16-0/versions.js +4 -0
- package/dist/chrome/panes-3-16-0/web-extension-C3pMNVSY.js +144 -0
- package/dist/chrome/panes-3-16-0/websocket-debug.js +60 -0
- package/dist/firefox/content-script.js +1 -0
- package/dist/firefox/manifest.json +3 -3
- package/dist/{chrome/panes-3-16-0/assets/chunk.524.f09748f2f97c650a11d4.js → firefox/panes-3-16-0/assets/chunk.524.8fa2f652e1d638cb866d.js} +4 -4
- package/dist/{websocket/assets/chunk.582.745520fa87699e11d9c5.js → firefox/panes-3-16-0/assets/chunk.582.325d02fae0e9f262a1ae.js} +5 -5
- package/dist/firefox/panes-3-16-0/assets/ember-inspector.css +835 -0
- package/dist/firefox/panes-3-16-0/assets/ember-inspector.js +42 -4
- package/dist/firefox/panes-3-16-0/assets/vendor.css +0 -836
- package/dist/firefox/panes-3-16-0/assets/vendor.js +3967 -4019
- package/dist/firefox/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
- package/dist/firefox/panes-3-16-0/basic-DfbgtngO.js +144 -0
- package/dist/firefox/panes-3-16-0/basic-debug.js +6 -0
- package/dist/firefox/panes-3-16-0/bookmarklet-debug.js +34 -0
- package/dist/firefox/panes-3-16-0/chrome-debug.js +12 -0
- package/dist/firefox/panes-3-16-0/ember.js +108 -0
- package/dist/firefox/panes-3-16-0/ember_debug.js +28 -10654
- package/dist/firefox/panes-3-16-0/evented-BCTya3yE.js +62 -0
- package/dist/firefox/panes-3-16-0/firefox-debug.js +32 -0
- package/dist/firefox/panes-3-16-0/index.html +3 -3
- package/dist/firefox/panes-3-16-0/internals-CRmXMEzb.js +12 -0
- package/dist/firefox/panes-3-16-0/main.js +7642 -0
- package/dist/firefox/panes-3-16-0/port.js +108 -0
- package/dist/firefox/panes-3-16-0/profile-node.js +60 -0
- package/dist/firefox/panes-3-16-0/promise-assembler.js +218 -0
- package/dist/firefox/panes-3-16-0/runloop-CF-Qpqgy.js +1138 -0
- package/dist/firefox/panes-3-16-0/start-inspector-BPAW_WLv.js +376 -0
- package/dist/firefox/panes-3-16-0/type-check.js +119 -0
- package/dist/firefox/panes-3-16-0/version.js +90 -0
- package/dist/firefox/panes-3-16-0/versions.js +4 -0
- package/dist/firefox/panes-3-16-0/web-extension-C3pMNVSY.js +144 -0
- package/dist/firefox/panes-3-16-0/websocket-debug.js +60 -0
- package/dist/websocket/assets/{chunk.524.f09748f2f97c650a11d4.js → chunk.524.8fa2f652e1d638cb866d.js} +4 -4
- package/dist/{chrome/panes-3-16-0/assets/chunk.582.745520fa87699e11d9c5.js → websocket/assets/chunk.582.325d02fae0e9f262a1ae.js} +5 -5
- package/dist/websocket/assets/ember-inspector.css +835 -0
- package/dist/websocket/assets/ember-inspector.js +42 -4
- package/dist/websocket/assets/vendor.css +0 -836
- package/dist/websocket/assets/vendor.js +3967 -4019
- package/dist/websocket/base-object-HAEdWjmg.js +59 -0
- package/dist/websocket/basic-DfbgtngO.js +144 -0
- package/dist/websocket/basic-debug.js +6 -0
- package/dist/websocket/bookmarklet-debug.js +34 -0
- package/dist/websocket/chrome-debug.js +12 -0
- package/dist/websocket/ember.js +108 -0
- package/dist/websocket/ember_debug.js +36 -10634
- package/dist/websocket/evented-BCTya3yE.js +62 -0
- package/dist/websocket/firefox-debug.js +32 -0
- package/dist/websocket/index.html +3 -3
- package/dist/websocket/internals-CRmXMEzb.js +12 -0
- package/dist/websocket/main.js +7642 -0
- package/dist/websocket/port.js +108 -0
- package/dist/websocket/profile-node.js +60 -0
- package/dist/websocket/promise-assembler.js +218 -0
- package/dist/websocket/runloop-CF-Qpqgy.js +1138 -0
- package/dist/websocket/start-inspector-BPAW_WLv.js +376 -0
- package/dist/websocket/type-check.js +119 -0
- package/dist/websocket/version.js +90 -0
- package/dist/websocket/versions.js +4 -0
- package/dist/websocket/web-extension-C3pMNVSY.js +144 -0
- package/dist/websocket/websocket-debug.js +60 -0
- package/ember-cli-build.js +28 -91
- package/ember_debug/adapters/basic.js +9 -29
- package/ember_debug/adapters/web-extension.js +4 -4
- package/ember_debug/adapters/websocket.js +2 -2
- package/ember_debug/container-debug.js +1 -1
- package/ember_debug/data-debug.js +2 -2
- package/ember_debug/debug-port.js +1 -1
- package/ember_debug/deprecation-debug.js +6 -6
- package/ember_debug/entrypoints/basic-debug.js +6 -0
- package/ember_debug/entrypoints/bookmarklet-debug.js +6 -0
- package/ember_debug/entrypoints/chrome-debug.js +6 -0
- package/ember_debug/entrypoints/firefox-debug.js +6 -0
- package/ember_debug/entrypoints/websocket-debug.js +6 -0
- package/ember_debug/general-debug.js +3 -3
- package/ember_debug/lib/boot-ember-inspector.js +9 -0
- package/ember_debug/lib/get-applications.js +27 -0
- package/ember_debug/lib/load-ember-debug-in-webpage.js +30 -0
- package/ember_debug/lib/send-apps.js +14 -0
- package/ember_debug/lib/send-version-miss.js +39 -0
- package/ember_debug/lib/setup-instance-initializer.js +16 -0
- package/ember_debug/lib/start-inspector.js +211 -0
- package/ember_debug/lib/version-test.js +73 -0
- package/ember_debug/lib/versions.js +3 -0
- package/ember_debug/libs/capture-render-tree.js +1 -1
- package/ember_debug/libs/promise-assembler.js +4 -4
- package/ember_debug/libs/render-tree.js +5 -5
- package/ember_debug/libs/source-map.js +1 -1
- package/ember_debug/libs/view-inspection.js +3 -3
- package/ember_debug/main.js +17 -20
- package/ember_debug/models/profile-manager.js +5 -6
- package/ember_debug/models/profile-node.js +1 -1
- package/ember_debug/models/promise.js +2 -2
- package/ember_debug/object-inspector.js +9 -9
- package/ember_debug/package.json +3 -1
- package/ember_debug/port.js +4 -4
- package/ember_debug/promise-debug.js +4 -4
- package/ember_debug/render-debug.js +5 -5
- package/ember_debug/rollup.config.js +5 -29
- package/ember_debug/route-debug.js +7 -7
- package/ember_debug/services/session.js +1 -1
- package/ember_debug/utils/ember/object/internals.js +1 -6
- package/ember_debug/utils/ember/runloop.js +2 -7
- package/ember_debug/utils/ember-object-names.js +2 -2
- package/ember_debug/utils/ember.js +72 -28
- package/ember_debug/utils/get-object-name.js +1 -1
- package/ember_debug/utils/type-check.js +2 -2
- package/ember_debug/view-debug.js +4 -4
- package/package.json +6 -9
- package/skeletons/bookmarklet/load_inspector.js +1 -0
- package/skeletons/web-extension/content-script.js +1 -0
- package/skeletons/web-extension/manifest.json +3 -3
- package/tests/ember_debug/profile-manager-test.js +1 -3
- package/tests/index.html +1 -2
- package/tests/integration/injection-test.js +3 -3
- package/tests/test-helper.js +0 -3
- package/ember_debug/utils/ember/debug.js +0 -21
- package/ember_debug/utils/ember/instrumentation.js +0 -11
- package/ember_debug/utils/rsvp.js +0 -14
- package/ember_debug/vendor/loader.js +0 -54
- package/ember_debug/vendor/startup-wrapper.js +0 -402
- package/lib/ui/app/components/ui/disclosure-triangle.js +0 -1
- package/lib/ui/app/components/ui/disclosure.js +0 -1
- package/lib/ui/app/components/ui/drag-handle.js +0 -1
- package/lib/ui/app/components/ui/draggable-column.js +0 -1
- package/lib/ui/app/components/ui/empty-message.js +0 -1
- package/lib/ui/app/components/ui/error-page.js +0 -1
- package/lib/ui/app/components/ui/open-links-in-new-window.js +0 -1
- package/lib/ui/app/components/ui/resizable-column.js +0 -1
- package/lib/ui/app/components/ui/send-to-console.js +0 -1
- package/lib/ui/app/components/ui/toolbar-clear-button.js +0 -1
- package/lib/ui/app/components/ui/toolbar-divider.js +0 -1
- package/lib/ui/app/components/ui/toolbar-reload-button.js +0 -1
- package/lib/ui/app/components/ui/toolbar-search-field.js +0 -1
- package/lib/ui/app/components/ui/warning-message.js +0 -1
- package/lib/ui/index.js +0 -34
- package/lib/ui/package.json +0 -13
- /package/{lib/ui/addon/components → app/components/ui}/disclosure-triangle.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/disclosure.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/disclosure.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/drag-handle.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/drag-handle.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/draggable-column.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/draggable-column.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/empty-message.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/error-page.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/open-links-in-new-window.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/open-links-in-new-window.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/resizable-column.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/resizable-column.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/send-to-console.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-clear-button.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-divider.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-reload-button.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-search-field.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-search-field.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/warning-message.hbs +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_disclosure-triangle.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_drag-handle.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_empty-message.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_error-page.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_goto-source.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_list.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_nav.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_object-inspector-toggle.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_pill.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_send-to-console.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_split.scss +0 -0
- /package/{lib/ui/addon/styles/addon.scss → app/styles/ui/_ui.scss} +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_warning.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_checkbox.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_divider.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_icon-button.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_index.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_radio.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_search.scss +0 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { B as BasicAdapter } from './basic-DfbgtngO.js';
|
|
2
|
+
import { typeOf } from './type-check.js';
|
|
3
|
+
import { getEnv } from './ember.js';
|
|
4
|
+
import { r as run } from './runloop-CF-Qpqgy.js';
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
isArray
|
|
8
|
+
} = Array;
|
|
9
|
+
const {
|
|
10
|
+
keys
|
|
11
|
+
} = Object;
|
|
12
|
+
class WebExtension extends BasicAdapter {
|
|
13
|
+
// eslint-disable-next-line ember/classic-decorator-hooks
|
|
14
|
+
init() {
|
|
15
|
+
this._channel = new MessageChannel();
|
|
16
|
+
this._chromePort = this._channel?.port1;
|
|
17
|
+
super.init();
|
|
18
|
+
}
|
|
19
|
+
connect() {
|
|
20
|
+
const channel = this._channel;
|
|
21
|
+
return super.connect().then(() => {
|
|
22
|
+
window.postMessage('debugger-client', '*', [channel.port2]);
|
|
23
|
+
this._listen();
|
|
24
|
+
}, null);
|
|
25
|
+
}
|
|
26
|
+
sendMessage(options = {}) {
|
|
27
|
+
// If prototype extensions are disabled, `Ember.A()` arrays
|
|
28
|
+
// would not be considered native arrays, so it's not possible to
|
|
29
|
+
// "clone" them through postMessage unless they are converted to a
|
|
30
|
+
// native array.
|
|
31
|
+
options = deepClone(options);
|
|
32
|
+
try {
|
|
33
|
+
this._chromePort.postMessage(options);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.log('failed to send message', e);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Open the devtools "Elements" and select an DOM node.
|
|
41
|
+
*
|
|
42
|
+
* @param {Node|Function} value The DOM node to select
|
|
43
|
+
*/
|
|
44
|
+
inspectValue(value) {
|
|
45
|
+
// NOTE:
|
|
46
|
+
//
|
|
47
|
+
// Basically, we are just trying to call `inspect(node)` here.
|
|
48
|
+
// However, `inspect` is a special function that is in the global
|
|
49
|
+
// scope but not on the global object (i.e. `window.inspect`) does
|
|
50
|
+
// not work. This sometimes causes problems, because, e.g. if the
|
|
51
|
+
// page has a div with the ID `inspect`, `window.inspect` will point
|
|
52
|
+
// to that div and shadow the "global" inspect function with no way
|
|
53
|
+
// to get it back. That causes "`inspect` is not a function" errors.
|
|
54
|
+
//
|
|
55
|
+
// As it turns out, however, when the extension page evals, the
|
|
56
|
+
// `inspect` function does not get shadowed. So, we can ask the
|
|
57
|
+
// inspector extension page to call that function for us, using
|
|
58
|
+
// `inspected.Window.eval('inspect(node)')`.
|
|
59
|
+
//
|
|
60
|
+
// However, since we cannot just send the DOM node directly to the
|
|
61
|
+
// extension, we will have to store it in a temporary global variable
|
|
62
|
+
// so that the extension can find it.
|
|
63
|
+
|
|
64
|
+
let name = `__EMBER_INSPECTOR_${(Math.random() * 100000000).toFixed(0)}`;
|
|
65
|
+
window[name] = value;
|
|
66
|
+
this.namespace.port.send('view:inspectJSValue', {
|
|
67
|
+
name
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
_listen() {
|
|
71
|
+
let chromePort = this._chromePort;
|
|
72
|
+
chromePort.addEventListener('message', event => {
|
|
73
|
+
const message = event.data;
|
|
74
|
+
|
|
75
|
+
// We should generally not be run-wrapping here. Starting a runloop in
|
|
76
|
+
// ember-debug will cause the inspected app to revalidate/rerender. We
|
|
77
|
+
// are generally not intending to cause changes to the rendered output
|
|
78
|
+
// of the app, so this is generally unnecessary, and in big apps this
|
|
79
|
+
// could be quite slow. There is nothing special about the `view:*`
|
|
80
|
+
// messages – I (GC) just happened to have reviewed all of them recently
|
|
81
|
+
// and can be quite sure that they don't need the runloop. We should
|
|
82
|
+
// audit the rest of them and see if we can remove the else branch. I
|
|
83
|
+
// think we most likely can. In the limited cases (if any) where the
|
|
84
|
+
// runloop is needed, the callback code should just do the wrapping
|
|
85
|
+
// themselves.
|
|
86
|
+
if (message.type.startsWith('view:')) {
|
|
87
|
+
this._messageReceived(message);
|
|
88
|
+
} else {
|
|
89
|
+
run(() => {
|
|
90
|
+
this._messageReceived(message);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
chromePort.start();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// On some older Ember version `Ember.ENV.EXTEND_PROTOTYPES` is not
|
|
99
|
+
// guarenteed to be an object. While this code only support 3.4+ (all
|
|
100
|
+
// of which normalizes `EXTEND_PROTOTYPES` for us), startup-wrapper.js
|
|
101
|
+
// eagerly require/load ember-debug modules, which ultimately causes
|
|
102
|
+
// this top-level code to run, even we are going to pick a different
|
|
103
|
+
// adapter later. See GH #1114.
|
|
104
|
+
const HAS_ARRAY_PROTOTYPE_EXTENSIONS = (() => {
|
|
105
|
+
try {
|
|
106
|
+
return getEnv().EXTEND_PROTOTYPES.Array === true;
|
|
107
|
+
} catch {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
})();
|
|
111
|
+
let deepClone;
|
|
112
|
+
if (HAS_ARRAY_PROTOTYPE_EXTENSIONS) {
|
|
113
|
+
deepClone = function deepClone(item) {
|
|
114
|
+
return item;
|
|
115
|
+
};
|
|
116
|
+
} else {
|
|
117
|
+
/**
|
|
118
|
+
* Recursively clones all arrays. Needed because Chrome
|
|
119
|
+
* refuses to clone Ember Arrays when extend prototypes is disabled.
|
|
120
|
+
*
|
|
121
|
+
* If the item passed is an array, a clone of the array is returned.
|
|
122
|
+
* If the item is an object or an array, or array properties/items are cloned.
|
|
123
|
+
*
|
|
124
|
+
* @param {Mixed} item The item to clone
|
|
125
|
+
* @return {Mixed}
|
|
126
|
+
*/
|
|
127
|
+
deepClone = function deepClone(item) {
|
|
128
|
+
let clone = item;
|
|
129
|
+
if (isArray(item)) {
|
|
130
|
+
clone = new Array(item.length);
|
|
131
|
+
item.forEach((child, key) => {
|
|
132
|
+
clone[key] = deepClone(child);
|
|
133
|
+
});
|
|
134
|
+
} else if (item && typeOf(item) === 'object') {
|
|
135
|
+
clone = {};
|
|
136
|
+
keys(item).forEach(key => {
|
|
137
|
+
clone[key] = deepClone(item[key]);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return clone;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export { WebExtension as W };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { l as loadEmberDebugInWebpage, o as onEmberReady, s as startInspector } from './start-inspector-BPAW_WLv.js';
|
|
2
|
+
import { B as BasicAdapter, o as onReady } from './basic-DfbgtngO.js';
|
|
3
|
+
import { r as run } from './runloop-CF-Qpqgy.js';
|
|
4
|
+
import './versions.js';
|
|
5
|
+
import './base-object-HAEdWjmg.js';
|
|
6
|
+
import './ember.js';
|
|
7
|
+
|
|
8
|
+
class adapter extends BasicAdapter {
|
|
9
|
+
sendMessage(options = {}) {
|
|
10
|
+
this.socket.emit('emberInspectorMessage', options);
|
|
11
|
+
}
|
|
12
|
+
get socket() {
|
|
13
|
+
return window.EMBER_INSPECTOR_CONFIG.remoteDebugSocket;
|
|
14
|
+
}
|
|
15
|
+
_listen() {
|
|
16
|
+
this.socket.on('emberInspectorMessage', message => {
|
|
17
|
+
// We should generally not be run-wrapping here. Starting a runloop in
|
|
18
|
+
// ember-debug will cause the inspected app to revalidate/rerender. We
|
|
19
|
+
// are generally not intending to cause changes to the rendered output
|
|
20
|
+
// of the app, so this is generally unnecessary, and in big apps this
|
|
21
|
+
// could be quite slow. There is nothing special about the `view:*`
|
|
22
|
+
// messages – I (GC) just happened to have reviewed all of them recently
|
|
23
|
+
// and can be quite sure that they don't need the runloop. We should
|
|
24
|
+
// audit the rest of them and see if we can remove the else branch. I
|
|
25
|
+
// think we most likely can. In the limited cases (if any) where the
|
|
26
|
+
// runloop is needed, the callback code should just do the wrapping
|
|
27
|
+
// themselves.
|
|
28
|
+
if (message.type.startsWith('view:')) {
|
|
29
|
+
this._messageReceived(message);
|
|
30
|
+
} else {
|
|
31
|
+
run(() => {
|
|
32
|
+
this._messageReceived(message);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
_disconnect() {
|
|
38
|
+
this.socket.removeAllListeners('emberInspectorMessage');
|
|
39
|
+
}
|
|
40
|
+
connect() {
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
onReady(() => {
|
|
43
|
+
if (this.isDestroyed) {
|
|
44
|
+
reject();
|
|
45
|
+
}
|
|
46
|
+
const EMBER_INSPECTOR_CONFIG = window.EMBER_INSPECTOR_CONFIG;
|
|
47
|
+
if (typeof EMBER_INSPECTOR_CONFIG === 'object' && EMBER_INSPECTOR_CONFIG.remoteDebugSocket) {
|
|
48
|
+
resolve();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}).then(() => {
|
|
52
|
+
this._listen();
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
willDestroy() {
|
|
56
|
+
this._disconnect();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
loadEmberDebugInWebpage(() => onEmberReady(startInspector(adapter)));
|
package/ember-cli-build.js
CHANGED
|
@@ -9,7 +9,12 @@ const writeFile = require('broccoli-file-creator');
|
|
|
9
9
|
const replace = require('broccoli-string-replace');
|
|
10
10
|
const Funnel = require('broccoli-funnel');
|
|
11
11
|
const packageJson = require('./package.json');
|
|
12
|
-
const {
|
|
12
|
+
const { mv } = stew;
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
EMBER_VERSIONS_SUPPORTED,
|
|
16
|
+
PREVIOUS_EMBER_VERSIONS_SUPPORTED,
|
|
17
|
+
} = require('ember-debug/versions');
|
|
13
18
|
|
|
14
19
|
const options = {
|
|
15
20
|
autoImport: {
|
|
@@ -84,95 +89,30 @@ module.exports = function (defaults) {
|
|
|
84
89
|
app.import('node_modules/compare-versions/index.js');
|
|
85
90
|
app.import('node_modules/normalize.css/normalize.css');
|
|
86
91
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
include: ['**/*.js'],
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const previousEmberVersionsSupportedString = `[${packageJson.previousEmberVersionsSupported
|
|
95
|
-
.map(function (item) {
|
|
96
|
-
return `'${item}'`;
|
|
97
|
-
})
|
|
98
|
-
.join(',')}]`;
|
|
99
|
-
const emberVersionsSupportedString = `[${packageJson.emberVersionsSupported
|
|
100
|
-
.map(function (item) {
|
|
101
|
-
return `'${item}'`;
|
|
102
|
-
})
|
|
103
|
-
.join(',')}]`;
|
|
104
|
-
|
|
105
|
-
let startupWrapper = new Funnel('ember_debug', {
|
|
106
|
-
srcDir: 'vendor',
|
|
107
|
-
files: ['startup-wrapper.js'],
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
startupWrapper = replace(startupWrapper, {
|
|
111
|
-
files: ['startup-wrapper.js'],
|
|
112
|
-
patterns: [
|
|
113
|
-
{
|
|
114
|
-
match: /{{EMBER_VERSIONS_SUPPORTED}}/,
|
|
115
|
-
replacement: emberVersionsSupportedString,
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
const loader = new Funnel('ember_debug', {
|
|
121
|
-
srcDir: 'vendor',
|
|
122
|
-
files: ['loader.js'],
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
emberDebug = mergeTrees([startupWrapper, emberDebug, loader]);
|
|
126
|
-
|
|
127
|
-
emberDebug = concatFiles(emberDebug, {
|
|
128
|
-
headerFiles: ['loader.js'],
|
|
129
|
-
inputFiles: ['**/*.js'],
|
|
130
|
-
outputFile: '/ember_debug.js',
|
|
131
|
-
sourceMapConfig: { enabled: false },
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
function wrapWithLoader(content) {
|
|
135
|
-
return `(function loadEmberDebugInWebpage() {
|
|
136
|
-
const waitForEmberLoad = new Promise((resolve) => {
|
|
137
|
-
if (window.requireModule) {
|
|
138
|
-
const has =
|
|
139
|
-
window.requireModule.has ||
|
|
140
|
-
function has(id) {
|
|
141
|
-
return !!(
|
|
142
|
-
window.requireModule.entries[id] ||
|
|
143
|
-
window.requireModule.entries[id + '/index']
|
|
144
|
-
);
|
|
145
|
-
};
|
|
146
|
-
if (has('ember')) {
|
|
147
|
-
return resolve();
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* NOTE: if the above (for some reason) fails and the consuming app has
|
|
153
|
-
* deprecation-workflow's throwOnUnhandled: true
|
|
154
|
-
* or set \`ember-global\`'s handler to 'throw'
|
|
155
|
-
* and is using at least \`ember-source@3.27\`
|
|
156
|
-
*
|
|
157
|
-
* this will throw an exception in the consuming project
|
|
158
|
-
*/
|
|
159
|
-
if (window.Ember) return resolve();
|
|
160
|
-
|
|
161
|
-
window.addEventListener('Ember', resolve, { once: true });
|
|
162
|
-
});
|
|
163
|
-
waitForEmberLoad.then(() => ${content});
|
|
164
|
-
})()
|
|
165
|
-
`;
|
|
166
|
-
}
|
|
92
|
+
const previousEmberVersionsSupportedString = JSON.stringify(
|
|
93
|
+
PREVIOUS_EMBER_VERSIONS_SUPPORTED,
|
|
94
|
+
);
|
|
95
|
+
const emberVersionsSupportedString = JSON.stringify(EMBER_VERSIONS_SUPPORTED);
|
|
167
96
|
|
|
168
97
|
const emberDebugs = [];
|
|
98
|
+
|
|
169
99
|
['basic', 'chrome', 'firefox', 'bookmarklet', 'websocket'].forEach(
|
|
170
100
|
function (dist) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
101
|
+
let emberDebug = 'ember_debug/dist';
|
|
102
|
+
|
|
103
|
+
let entryPoint = concatFiles(
|
|
104
|
+
new Funnel(emberDebug, {
|
|
105
|
+
destDir: 'ember-debug',
|
|
106
|
+
include: [`${dist}-debug.js`],
|
|
107
|
+
}),
|
|
108
|
+
{
|
|
109
|
+
inputFiles: ['**/*.js'],
|
|
110
|
+
outputFile: '/ember_debug.js',
|
|
111
|
+
sourceMapConfig: { enabled: false },
|
|
112
|
+
},
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
emberDebugs[dist] = mergeTrees([emberDebug, entryPoint]);
|
|
176
116
|
},
|
|
177
117
|
);
|
|
178
118
|
|
|
@@ -190,10 +130,7 @@ module.exports = function (defaults) {
|
|
|
190
130
|
patterns: emberInspectorVersionPattern,
|
|
191
131
|
});
|
|
192
132
|
|
|
193
|
-
const minimumVersion =
|
|
194
|
-
/\./g,
|
|
195
|
-
'-',
|
|
196
|
-
);
|
|
133
|
+
const minimumVersion = EMBER_VERSIONS_SUPPORTED[0].replace(/\./g, '-');
|
|
197
134
|
const webExtensionRoot = `panes-${minimumVersion}`;
|
|
198
135
|
|
|
199
136
|
let tabLabel;
|
|
@@ -264,7 +201,7 @@ module.exports = function (defaults) {
|
|
|
264
201
|
skeletonBookmarklet,
|
|
265
202
|
]);
|
|
266
203
|
|
|
267
|
-
|
|
204
|
+
PREVIOUS_EMBER_VERSIONS_SUPPORTED.forEach(function (version) {
|
|
268
205
|
version = version.replace(/\./g, '-');
|
|
269
206
|
if (env === 'production') {
|
|
270
207
|
const prevDist = `dist_prev/${env}`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint no-console: 0 */
|
|
2
|
-
import { onReady } from '
|
|
3
|
-
import BaseObject from '../utils/base-object';
|
|
2
|
+
import { onReady } from '../utils/on-ready';
|
|
3
|
+
import BaseObject from '../utils/base-object.js';
|
|
4
4
|
|
|
5
5
|
export default class BasicAdapter extends BaseObject {
|
|
6
6
|
// eslint-disable-next-line ember/classic-decorator-hooks
|
|
@@ -12,21 +12,6 @@ export default class BasicAdapter extends BaseObject {
|
|
|
12
12
|
this._messageCallbacks = [];
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Uses the current build's config module to determine
|
|
17
|
-
* the environment.
|
|
18
|
-
*
|
|
19
|
-
* @property environment
|
|
20
|
-
* @type {String}
|
|
21
|
-
*/
|
|
22
|
-
get environment() {
|
|
23
|
-
if (!this.__environment) {
|
|
24
|
-
this.__environment =
|
|
25
|
-
requireModule('ember-debug/config')['default'].environment;
|
|
26
|
-
}
|
|
27
|
-
return this.__environment;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
15
|
debug() {
|
|
31
16
|
return console.debug(...arguments);
|
|
32
17
|
}
|
|
@@ -94,19 +79,14 @@ export default class BasicAdapter extends BaseObject {
|
|
|
94
79
|
* @param {Error} error
|
|
95
80
|
*/
|
|
96
81
|
handleError(error) {
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
-
error = `Error message: ${error.message}\nStack trace: ${error.stack}`;
|
|
100
|
-
}
|
|
101
|
-
this.warn(
|
|
102
|
-
`Ember Inspector has errored.\n` +
|
|
103
|
-
`This is likely a bug in the inspector itself.\n` +
|
|
104
|
-
`You can report bugs at https://github.com/emberjs/ember-inspector.\n${error}`,
|
|
105
|
-
);
|
|
106
|
-
} else {
|
|
107
|
-
this.warn('EmberDebug has errored:');
|
|
108
|
-
throw error;
|
|
82
|
+
if (error && error instanceof Error) {
|
|
83
|
+
error = `Error message: ${error.message}\nStack trace: ${error.stack}`;
|
|
109
84
|
}
|
|
85
|
+
this.warn(
|
|
86
|
+
`Ember Inspector has errored.\n` +
|
|
87
|
+
`This is likely a bug in the inspector itself.\n` +
|
|
88
|
+
`You can report bugs at https://github.com/emberjs/ember-inspector.\n${error}`,
|
|
89
|
+
);
|
|
110
90
|
}
|
|
111
91
|
|
|
112
92
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import BasicAdapter from './basic';
|
|
2
|
-
import { typeOf } from '
|
|
2
|
+
import { typeOf } from '../utils/type-check';
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import { run } from '
|
|
4
|
+
import { getEnv } from '../utils/ember';
|
|
5
|
+
import { run } from '../utils/ember/runloop';
|
|
6
6
|
|
|
7
7
|
const { isArray } = Array;
|
|
8
8
|
const { keys } = Object;
|
|
@@ -106,7 +106,7 @@ export default class extends BasicAdapter {
|
|
|
106
106
|
// adapter later. See GH #1114.
|
|
107
107
|
const HAS_ARRAY_PROTOTYPE_EXTENSIONS = (() => {
|
|
108
108
|
try {
|
|
109
|
-
return
|
|
109
|
+
return getEnv().EXTEND_PROTOTYPES.Array === true;
|
|
110
110
|
} catch {
|
|
111
111
|
return false;
|
|
112
112
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BasicAdapter from './basic';
|
|
2
|
-
import { onReady } from '
|
|
3
|
-
import { run } from '
|
|
2
|
+
import { onReady } from '../utils/on-ready';
|
|
3
|
+
import { run } from '../utils/ember/runloop';
|
|
4
4
|
|
|
5
5
|
export default class extends BasicAdapter {
|
|
6
6
|
sendMessage(options = {}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import DebugPort from './debug-port';
|
|
2
|
-
import { guidFor } from '
|
|
1
|
+
import DebugPort from './debug-port.js';
|
|
2
|
+
import { guidFor } from './utils/ember/object/internals';
|
|
3
3
|
|
|
4
4
|
export default class extends DebugPort {
|
|
5
5
|
// eslint-disable-next-line ember/classic-decorator-hooks
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import DebugPort from './debug-port';
|
|
2
|
-
import SourceMap from '
|
|
1
|
+
import DebugPort from './debug-port.js';
|
|
2
|
+
import SourceMap from './libs/source-map';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import { guidFor } from '
|
|
6
|
-
import { cancel, debounce } from '
|
|
4
|
+
import { Debug } from './utils/ember';
|
|
5
|
+
import { guidFor } from './utils/ember/object/internals';
|
|
6
|
+
import { cancel, debounce } from './utils/ember/runloop';
|
|
7
7
|
|
|
8
8
|
export default class extends DebugPort {
|
|
9
9
|
static {
|
|
@@ -194,7 +194,7 @@ export default class extends DebugPort {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
handleDeprecations() {
|
|
197
|
-
registerDeprecationHandler((message, options, next) => {
|
|
197
|
+
Debug.registerDeprecationHandler((message, options, next) => {
|
|
198
198
|
if (!this.adapter) {
|
|
199
199
|
next(message, options);
|
|
200
200
|
return;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import loadEmberDebugInWebpage from '../lib/load-ember-debug-in-webpage';
|
|
2
|
+
import { onEmberReady, startInspector } from '../lib/start-inspector';
|
|
3
|
+
|
|
4
|
+
import adapter from '../adapters/bookmarklet';
|
|
5
|
+
|
|
6
|
+
loadEmberDebugInWebpage(() => onEmberReady(startInspector(adapter)));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint no-empty:0 */
|
|
2
|
-
import DebugPort from './debug-port';
|
|
2
|
+
import DebugPort from './debug-port.js';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import { libraries } from './utils/ember';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Class that handles gathering general information of the inspected app.
|
|
@@ -88,7 +88,7 @@ export default class extends DebugPort {
|
|
|
88
88
|
*/
|
|
89
89
|
getLibraries() {
|
|
90
90
|
this.sendMessage('libraries', {
|
|
91
|
-
libraries:
|
|
91
|
+
libraries: libraries?._registry,
|
|
92
92
|
});
|
|
93
93
|
},
|
|
94
94
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default function bootEmberInspector(appInstance) {
|
|
2
|
+
appInstance.application.__inspector__booted = true;
|
|
3
|
+
appInstance.__inspector__booted = true;
|
|
4
|
+
|
|
5
|
+
// Boot the inspector (or re-boot if already booted, for example in tests)
|
|
6
|
+
window.EmberInspector._application = appInstance.application;
|
|
7
|
+
window.EmberInspector.owner = appInstance;
|
|
8
|
+
window.EmberInspector.start(true);
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* eslint-disable ember/new-module-imports */
|
|
2
|
+
/**
|
|
3
|
+
* Get all the Ember.Application instances from Ember.Namespace.NAMESPACES
|
|
4
|
+
* and add our own applicationId and applicationName to them
|
|
5
|
+
* @return {*}
|
|
6
|
+
*/
|
|
7
|
+
export default function getApplications(Ember) {
|
|
8
|
+
var namespaces = Ember.A(Ember.Namespace.NAMESPACES);
|
|
9
|
+
|
|
10
|
+
var apps = namespaces.filter(function (namespace) {
|
|
11
|
+
return namespace instanceof Ember.Application;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
return apps.map(function (app) {
|
|
15
|
+
// Add applicationId and applicationName to the app
|
|
16
|
+
var applicationId = Ember.guidFor(app);
|
|
17
|
+
var applicationName =
|
|
18
|
+
app.name || app.modulePrefix || `(unknown app - ${applicationId})`;
|
|
19
|
+
|
|
20
|
+
Object.assign(app, {
|
|
21
|
+
applicationId,
|
|
22
|
+
applicationName,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return app;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default function loadEmberDebugInWebpage(callback) {
|
|
2
|
+
const waitForEmberLoad = new Promise((resolve) => {
|
|
3
|
+
if (window.requireModule) {
|
|
4
|
+
const has =
|
|
5
|
+
window.requireModule.has ||
|
|
6
|
+
function has(id) {
|
|
7
|
+
return !!(
|
|
8
|
+
window.requireModule.entries[id] ||
|
|
9
|
+
window.requireModule.entries[id + '/index']
|
|
10
|
+
);
|
|
11
|
+
};
|
|
12
|
+
if (has('ember')) {
|
|
13
|
+
return resolve();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* NOTE: if the above (for some reason) fails and the consuming app has
|
|
19
|
+
* deprecation-workflow's throwOnUnhandled: true
|
|
20
|
+
* or set \`ember-global\`'s handler to 'throw'
|
|
21
|
+
* and is using at least \`ember-source@3.27\`
|
|
22
|
+
*
|
|
23
|
+
* this will throw an exception in the consuming project
|
|
24
|
+
*/
|
|
25
|
+
if (window.Ember) return resolve();
|
|
26
|
+
|
|
27
|
+
window.addEventListener('Ember', resolve, { once: true });
|
|
28
|
+
});
|
|
29
|
+
waitForEmberLoad.then(callback);
|
|
30
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default function sendApps(adapter, apps) {
|
|
2
|
+
const serializedApps = apps.map((app) => {
|
|
3
|
+
return {
|
|
4
|
+
applicationName: app.applicationName,
|
|
5
|
+
applicationId: app.applicationId,
|
|
6
|
+
};
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
adapter.sendMessage({
|
|
10
|
+
type: 'apps-loaded',
|
|
11
|
+
apps: serializedApps,
|
|
12
|
+
from: 'inspectedWindow',
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable ember/new-module-imports */
|
|
2
|
+
let channel = new MessageChannel();
|
|
3
|
+
let port = channel.port1;
|
|
4
|
+
window.postMessage('debugger-client', '*', [channel.port2]);
|
|
5
|
+
|
|
6
|
+
let registeredMiss = false;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This function is called if the app's Ember version
|
|
10
|
+
* is not supported by this version of the inspector.
|
|
11
|
+
*
|
|
12
|
+
* It sends a message to the inspector app to redirect
|
|
13
|
+
* to an inspector version that supports this Ember version.
|
|
14
|
+
*/
|
|
15
|
+
export default function sendVersionMiss(Ember) {
|
|
16
|
+
if (registeredMiss) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
registeredMiss = true;
|
|
21
|
+
|
|
22
|
+
port.addEventListener('message', (message) => {
|
|
23
|
+
if (message.type === 'check-version') {
|
|
24
|
+
sendVersionMismatch();
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
sendVersionMismatch();
|
|
29
|
+
|
|
30
|
+
port.start();
|
|
31
|
+
|
|
32
|
+
function sendVersionMismatch() {
|
|
33
|
+
port.postMessage({
|
|
34
|
+
name: 'version-mismatch',
|
|
35
|
+
version: Ember.VERSION,
|
|
36
|
+
from: 'inspectedWindow',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|