Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge openwpm-webext-instrumentation repo #328

Merged
merged 144 commits into from
Jun 26, 2019

Conversation

motin
Copy link
Contributor

@motin motin commented Jun 25, 2019

For #300

Created with bitjson/typescript-starter@fd420b8

Disable tslint-immutable, Include VS Code debugging config, Include CircleCI config, Include Travis CI config
…error reporting for things happening in the background event listener
…ods previously found in loggingdb.js) and adhere to no-this-assignment rule once again
englehardt and others added 14 commits May 23, 2019 08:08
Return the response body as Uint8Array instead of string
A bit more customizable JS instrumentation
…essages before the data receiver has been configured + exposing handleJsInstrumentationMessage
In case that the HTTP POST data cannot be parsed as formData, it is also possible to access it as raw binary data. This was previously not supported by the extension and no HTTP POST data was logged for HTTP POST requests that failed to parse as formData by Firefox. This commit handles those cases as well.

The data is made available by Firefox as a list of 2-touples of filename - content pairs. The content is presented in a binary form. Since that content might not represent a valid utf8 string, a base64 encoding is applied so that the content is finally exported as a JSON encoded string.

This requires that the receiving code expects a new field named *post_body_raw*.
Handle raw HTTP POST data as well
…into merge-openwpm-webext-instrumentation-repo
@motin motin requested a review from englehardt June 25, 2019 08:20
motin added 3 commits June 25, 2019 11:22
…ad of branded firefox (which doesn't run web extension experiments)
…code at 2018-11-27 (the version was retroactively tagged and thus the code still contained the old version number)
@eriktews
Copy link
Contributor

eriktews commented Jun 25, 2019

Hi, about the Dockerfile: Could you move both extensions in a top level folder? I'm currently working on an improved Dockerfile and having the extension code in a dedicated top level folder would make things much more beautiful and also easier.

My current code is in: https://github.com/eriktews/OpenWPM/blob/dockerfile-dev/Dockerfile#L56 Since Docker doesn't have a "COPY --exclude" feature, having the extensions in a dedicated top level folder would make this part of the Dockerfile much shorter.

@motin
Copy link
Contributor Author

motin commented Jun 25, 2019

@eriktews There is only one extension, but if I understand correctly you' suggest that we move automation/Extension to a top-level folder like extension. Sounds reasonable to me but quite a lot of scripts and documentation needs to be updated to reflect that, so I suggest it'd be done in a separate PR that specifically addresses it.
(Btw, I'll happily review new PRs related to Dockerfile changes. :))

@eriktews
Copy link
Contributor

@eriktews There is only one extension, but if I understand correctly you' suggest that we move automation/Extension to a top-level folder like extension. Sounds reasonable to me but quite a lot of scripts and documentation needs to be updated to reflect that, so I suggest it'd be done in a separate PR that specifically addresses it.
(Btw, I'll happily review new PRs related to Dockerfile changes. :))

I created a PR for that: #332

So right now, I would just suggest to merge your PR as it is since it works with #332 too.

@motin motin requested a review from nhnt11 June 26, 2019 08:30
Copy link
Collaborator

@englehardt englehardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove/merge/update these files:

  • automation/Extension/webext-instrumentation/.gitignore
  • automation/Extension/webext-instrumentation/.travis.yml
  • automation/Extension/webext-instrumentation/README.md

It may also make sense to move the editor config and npm ignore files as well (at least up one directory so they apply to both the module and the extension).

@@ -10,7 +10,7 @@ const defaultConfig = {
overwriteDest: true,
},
run: {
firefox: process.env.FIREFOX_BINARY || "firefox",
firefox: process.env.FIREFOX_BINARY || "firefoxdeveloperedition",
Copy link
Collaborator

@englehardt englehardt Jun 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? From what I can tell the unbranded build is registered as "Nightly". It seems like we shouldn't need any fallback though, as we really only want to test/crawl with the firefox binary grabbed from our install script and throwing an error seems preferable to silently falling back to the system's firefox or dev edition binary. (If I'm misunderstanding how this is used, lmk).

Copy link
Contributor Author

@motin motin Jun 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this so that one can run npm start and get a working extension up and running in Firefox, rather than a broken experience. It'd be better if this can run the bundled Fx installation, but not sure how to set that up in a cross platform way. Using firefox dev edition to start the extension is at least better than the branded firefox (which doesn't run web extension experiments), but we can default to "nightly" too, albeit it may be less likely that extension developers have Nightly installed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(If I'm misunderstanding how this is used, lmk).

process.env.FIREFOX_BINARY allows developers to supply their preference when running npm commands, eg, FIREFOX_BINARY=nightly npm start or FIREFOX_BINARY=/Applications/Firefox.app/Contents/MacOS/firefox-bin npm start.

@motin
Copy link
Contributor Author

motin commented Jun 26, 2019

We should remove/merge/update these files:

With the idea of later splitting back this code into it's own repository, I suggest we keep some of these files:

automation/Extension/webext-instrumentation/.gitignore

I'd like to keep this one, since it is specific for the webext-instrumentation folder and should not be coupled with the framework gitignore rules.

automation/Extension/webext-instrumentation/.travis.yml

This one can be removed.

automation/Extension/webext-instrumentation/README.md

I'd like to keep a README / set of docs specific to this folder rather than merging with the framework docs. Again, it makes it easier to split later.

It may also make sense to move the editor config and npm ignore files as well (at least up one directory so they apply to both the module and the extension).

Npm ignore should be in the npm package root (ie where it is), but I am happy with merging editorconfig / code style configuration with the extension. It will however have to be moved back later when we re-split.

@englehardt
Copy link
Collaborator

Thanks for the follow ups. Moving back to a separate repo is a good reason to keep things as is.

@englehardt englehardt merged commit 4664746 into master Jun 26, 2019
@motin motin deleted the merge-openwpm-webext-instrumentation-repo branch June 27, 2019 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants