-
Notifications
You must be signed in to change notification settings - Fork 316
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
englehardt
merged 144 commits into
master
from
merge-openwpm-webext-instrumentation-repo
Jun 26, 2019
Merged
Changes from all commits
Commits
Show all changes
144 commits
Select commit
Hold shift + click to select a range
b6430fb
Initial commit
motin 9fdb23a
chore: Set initial version to 0.1.0
motin 6277db8
chore: Add npm run commit. Add commitizen as dev dependency
motin a4448bd
style: Modify prettier configuration
motin 03cff1b
chore: Remove example typings from boilerplate
motin 3ce6d14
build: Add npm run prepare so that build artifacts gets included in t…
motin 80e3dec
refactor: Renamed package to openwpm-webext-instrumentation
motin 743d765
Add typescript typings for Firefox web extensions apis
motin a9d8fc0
feat: Import reusable instrumentation from the OpenWPM repository
motin 94d856b
refactor: Move from js to ts file extensions
motin 4bcc6f3
docs: Update official repo url
motin 9aeafb5
refactor: Inject loggingDB into HttpPostParser at runtime
motin 3117632
refactor: Moved http-post-parser to lib folder
motin d54902e
refactor: Move all export declarations to a single file
motin a7a5b20
refactor: Moved out page-scoped js-instrumentation to separate file
motin 01f702d
style: npm run fix
motin 9e07ec5
style: Set severity of currently applicable tslint rules to warning i…
motin bb9c3c6
style: Adhere to tslint rule triple-equals
motin 980fda7
feat: Typescript compiles
motin 8e44ba8
feat: Improve lint and test npm scripts
motin bdc6415
refactor: Simplify module exports
motin e42c40b
refactor: Simplify the public interface
motin 689f4a7
fix: Not catching errors in emitMsg sendMessage since this fudges Fx …
motin 8429acd
feat: Make functional again when running in openwpm web extension
motin 12d4b58
fix: Make testing param in injectJavascriptInstrumentPageScript optional
motin 745f6bf
fix: Restore js instrumentation (including inclusion of relevant meth…
motin 91fa3ae
refactor: Rename loggingDB to dataReceiver
motin 8f1a324
fix: Export string-utils
motin 0815d9b
style: Add editorconfig
motin 8a6c84a
refactor: Use functions from lib/string-utils in http and cookie inst…
motin 446773d
feat: Add interfaces also for http and cookie updates
motin cf1b7a8
feat: Add schema-based typescript interfaces
motin e74ead7
fix: Use all three http-related interfaces in http instrumentation
motin e60c780
refactor: Use schema-based type interfaces in cookie and javascript i…
motin 9dbdb71
fix: Restore more of the cookie and http instrumentation
motin 7900632
fix: Move out typing definitions to separate file and continue the re…
motin c80b10f
feat: Add minimal readme instructions
motin 2677f6e
fix: Restore isJS() and get location header
motin 9c9d39c
fix: Valid SPDX license field
motin 53846db
fix: Restore more of the save response body logic
motin 369fe87
feat: Add sha256 hashing logic
motin d50dd63
fix: Use sha256 content hash logic
motin 65b2505
feat: Store resource type (as strings) instead of content policy type…
motin 17fec7b
fix: Restore isXHR check
motin 9f4be3a
fix: Remove varchar definitions in schema interfaces
motin 137651e
fix: Restore saving of response bodies
motin 4887745
fix: Restore is full page and is frame load checks
motin 3e22ac2
fix: Remove or comment out debug-related logging and mark yet-to-be-r…
motin 3955362
fix: Fix use of details.documentUrl
motin 63e0564
refactor: Make http post parser compile
motin 4d38abf
fix: Restore a light version of the http post parser which uses reque…
motin df223da
fix: Log pending request timeouts when encountered in post data handl…
motin 0f2522a
fix: Blocking listener does not block all requests
motin 1e9502d
refactor: Move OnChangedCause back into an import statement so that i…
motin 4dcaae7
docs: Remove sqlite-related part of a comment
motin 14c1248
feat: Add is_host_only, same_site and first_party_domain to cookie in…
motin 4e91061
fix: Cast all boolean data attributes to integers
motin f06cb95
refactor: A bit less magic string conversion method
motin 07d2d1f
fix: Return empty response and emit a debug message when POST request…
motin fbccd09
fix: Grab the corresponding values for the triggering and loading Pri…
motin 5cfed58
fix: Skip converting function arguments to an object
motin 8c12276
chore: Bump version to represent the many breaking changes
motin 3124a16
feat: Js instrumentation does no longer log to console except when de…
motin 6890b99
fix: Remove interfaces that are exclusively used by code outside the …
motin 411163c
fix: Dropped attributes related to the P3P policy of the cookie
motin 17810cc
refactor: Clarify which schema attributes are dates
motin af09bfc
feat: Http instrumentation cleanup() method
motin d9ade48
feat: Cookie + js instrumentation cleanup() methods
motin 2f877b2
fix: Export schema-based interfaces
motin 74b0f1c
docs: Add minimal docs about instrumentation to readme
motin f8c6ef4
fix: Schema interfaces properly exported in build
motin eeedb5a
fix: Use <all_urls> as request filter instead of only matching http(s…
motin 43a5619
fix: Typo
motin befc96a
fix: Don't assume responseHeaders always are available
motin c90b191
fix: Don't assume requestHeaders always are available
motin 12b7f97
fix: Drop attributes as discussed in PR conversations
motin 8a8ba34
fix: Http redirect request id more likely to correspond to old_channe…
motin 106af4c
fix: JS request type checks now only use RequestType (no longer conte…
motin f979546
fix: Restore HttpRequest.top_level_url (using the url of the requesti…
motin e6524f3
feat: Add HttpRequest.parent_frame_id and frame_ancestors
motin 0415637
feat: Add Cookie.change_cause
motin 52d946b
feat: Add time_stamp to cookie instrumentation
motin 9c38ab6
fix: Use ISO date format for Cookie.expiry (allowing us to drop the m…
motin 167839d
fix: Use ´request_id´ instead of `channel_id` in http-instrument
motin dcd28b3
Merge pull request #7 from mozilla/refactor-legacy-sdk-code-to-webext…
englehardt e40f2b0
Write data property sets to instance rather than prototype objects
englehardt 1af4022
Merge pull request #19 from englehardt/overwrite-fix
motin 989229b
feat: Instrument access to the document.referrer property
motin 56ec1fc
feat: Instrument navigations
motin 508538b
feat: Add Navigation.uuid
motin 9988e17
feat: Add general property extension_session_uuid to be able to disti…
motin 01bf7cc
feat: Add window, tab and frame id to http and javascript packets
motin 6c0eeb4
feat: Add Navigation.tab_opener_tab_id
motin e5ca954
feat: Record cookie store ids
motin 07d0681
feat: Add incognito attributes where applicable (navigation, http and…
motin bc2f8f1
feat: Add HttpRedirect.response_status and response_status_text
motin 094b43c
fix: Handle tabId being -1 in http and navigation instrument
motin 97bf14f
fix: Comment out unused parts of http-post-parsed (avoids the "unreac…
motin 41aaea0
feat: Tab/window dimensions and window type in Navigation instrument
motin af7944c
feat: CookieInstrument.saveAllCookies()
motin 5575d37
fix: Whitespace
motin 98659df
refactor: Minor code cleanup
motin 90b2c1d
fix: Remove two outdated comments
motin 40e4bdc
fix: Add HttpRedirect.old|new_request_url, restoring some sort of abi…
motin 73b35b8
fix: Restore HttpRequest.referrer
motin 698e402
feat: Keep track of the order of the original incoming events
motin abc6c7e
Merge pull request #11 from mozilla/several-enhancements
englehardt b63c947
style: Fix comment white-space in page-scoped js instrumentation
motin aa2f3bc
refactor: Small code cleanup
motin 47c46e1
feat: Record web navigation onBeforeNavigate timestamp, event ordinal…
motin 2df84a7
fix: Comment out HttpResponse.referrer in schema since it is currentl…
motin 778da7a
feat: Document and export the date time format used for time stamps
motin a8f3754
feat: Include timestamp in js instrumentation started console log mes…
motin 1d90b38
feat: Strip away data from data URLs before being stored
motin b29c338
Update npm-run-all to remove event-stream dependency
englehardt 889aba0
Merge pull request #32 from mozilla/remove-event-stream
motin 6469b58
Merge pull request #31 from mozilla/enhancements-batch-2
englehardt ecf4a4f
Add Mozilla Code of Conduct file
0f59d24
Merge pull request #41 from Mozilla-GitHub-Standards/master
englehardt d2d5b50
Moved core js instrumentation methods to a separate file
motin b967c51
Moved the instrumentation of fingerprinting apis to a separate file
motin cc6d8c7
Npm run fix
motin 38b8d16
Return the response body as Uint8Array instead of string
eriktews f9f912d
Save the contentHash in the database too
eriktews ca7e2c7
Remove commented out code
eriktews d64a766
Merge pull request #45 from eriktews/binary-response-body
englehardt 3ded79b
Merge pull request #42 from mozilla/a-bit-more-customizable
motin e1c00d9
Cleaned up javascript-instrumentation.ts + allowing it to listen to m…
motin 8dd157f
Merge pull request #44 from mozilla/js-instrument-listen-early
motin a8646d5
Handle raw HTTP POST data as well
eriktews ae4e9c0
Merge pull request #47 from eriktews/mozilla-raw-post
englehardt a408495
Moved some files temporarily pending repo merge
motin ab7ccb0
Merge remote-tracking branch 'openwpm-webext-instrumentation/master' …
motin 7e2b026
Moved webext-instrumentation into its own directory
motin 3478c03
Revert "Moved some files temporarily pending repo merge"
motin 4a91b35
Remove files that are only relevant at a root repository level
motin 1b17f6c
Updated package-lock.json files in automation/Extension
motin 826cd3c
Linked extension with local webext-instrumentation folder as dependency
motin 3a1e1eb
Updated docs to reflect the merged instrumentation repo
motin 5c46a62
Use firefox dev edition to start the extension while developing inste…
motin 29b8e0b
Install webext-instrumentation deps after installing extension deps
motin 3e8fc1d
Bumped instrumentation version retroactively to 0.3.0 to reflect the …
motin dab5d35
Updated Dockerfile to work with the merged webext-instrumentation
motin 49078b3
Removed the currently unused travis configuration for webext-instrume…
motin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
node_modules | ||
build | ||
test | ||
src/**.js | ||
.idea/* | ||
|
||
coverage | ||
.nyc_output | ||
*.log | ||
|
||
yarn.lock |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
src | ||
test | ||
tsconfig.json | ||
tsconfig.module.json | ||
tslint.json | ||
.travis.yml | ||
.github | ||
.prettierignore | ||
.vscode | ||
build/docs | ||
**/*.spec.* | ||
coverage | ||
.nyc_output | ||
*.log |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# package.json is formatted by package managers, so we ignore it here | ||
package.json |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# OpenWPM instrumentation library for WebExtensions | ||
|
||
Allows WebExtensions to track and monitor privacy-related browsing behavior | ||
|
||
## Installation | ||
|
||
This package is yet to be published to npm. | ||
|
||
## Instrumentation | ||
|
||
The instrumentation leverages the available [JavaScript APIs for WebExtensions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API) and listens to navigation, web requests, cookie modifications and access to certain javascript API:s, as described in [the main OpenWPM project README](https://github.com/citp/OpenWPM/tree/develop#instrumentation-and-data-access) under the following bullet points: | ||
- HTTP Request and Response Headers, redirects, and POST request bodies | ||
- Javascript Calls | ||
- Response body content | ||
- Cookie Access (Experimental) | ||
|
||
More specifically, all packets sent by the instrumentation conform to [these interfaces](https://github.com/mozilla/openwpm-webext-instrumentation/blob/refactor-legacy-sdk-code-to-webext-equivalent/src/schema.ts). | ||
|
||
## Usage | ||
|
||
The instrumentation is designed to invoke a `dataReceiver` object whenever a packet or log entry is available. | ||
|
||
Pending proper documentation, the best way to see how this library is used is to check how the instrumentation is incorporated into the following extensions: | ||
|
||
* https://github.com/mozilla/OpenWPM/tree/master/automation/Extension/firefox | ||
* https://github.com/motin/jestr-pioneer-shield-study |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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).
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.
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.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.
process.env.FIREFOX_BINARY
allows developers to supply their preference when running npm commands, eg,FIREFOX_BINARY=nightly npm start
orFIREFOX_BINARY=/Applications/Firefox.app/Contents/MacOS/firefox-bin npm start
.