-
Notifications
You must be signed in to change notification settings - Fork 57
Detect package name when using abstract socket address #43
Conversation
scanner.js
Outdated
@@ -169,7 +169,10 @@ FirefoxOnAndroidRuntime.prototype = Object.create(Runtime.prototype); | |||
|
|||
Object.defineProperty(FirefoxOnAndroidRuntime.prototype, "name", { | |||
get() { | |||
let packageName = this._socketPath.split("/")[3]; | |||
// If using abstract socket address, it is "@org.mozilla.firefox/..." | |||
let packageName = this._socketPath.startsWith("@") ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 'const' otherwise lint tools will complain when this change gets merged into devtools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, I just have a few questions related to https://bugzilla.mozilla.org/show_bug.cgi?id=1462019
After https://bugzilla.mozilla.org/show_bug.cgi?id=1462019, do we still need to handle the split("/")[3] ? Was this just related to using MOZ_ANDROID_DATA_DIR ? If this is the case could we add a comment to say that this._socketPath.split("/")[3]
is only useful for Firefox 62 or older? If not, please ignore this comment :)
Second question is about old runtimes. Are we sure there is no risk of having a MOZ_ANDROID_DATA_DIR starting with @?
So If WebIDE supports both version, we still need to support old style name. |
@makotokato Thanks for the feedback, maybe this could be added as a comment above |
b55db39
to
48e165f
Compare
48e165f
to
07db86f
Compare
@makotokato thanks for updating the comment! Any thoughts about my second question:
Happy to validate the review after this. |
When using abstract socket address, |
ok thanks! merging |
Follow up https://bugzilla.mozilla.org/show_bug.cgi?id=1462019. When using abstract socket address, its name is @/firefox-debugger-socket. So to recongnize package name in WebIDE, adbhelper should support this socket name.