Git Product home page Git Product logo

gecko-dev's Introduction

This branch contains modifications to the mozilla:release branch for compiling the Record Replay gecko based browser.

Getting started:

MacOS

If you are using Apple Silicone you should start by making sure you have a Rosetta terminal:

Then you should basically be able to follow the rest of the steps normally (with a couple of caveats called out down below - read carefully).

  1. Make sure that you are using Python v2.7
  2. cp mozconfig.macsample mozconfig
  3. Download MacOSX11.1.sdk.tar.xz from https://github.com/phracker/MacOSX-SDKs/releases
  4. Untar MacOSX11.1.sdk.tar.xz in the repo root to create a MacOSX11.1.sdk directory
  5. Run node build
    • On Apple Silicon, you many need to run RUSTC_BOOTSTRAP=qcms node build to build successfully.
  6. Run ./mach run

MacOS with Apple Silicone

Linux

  1. cp mozconfig.linuxsample mozconfig
  2. run ./mach bootstrap and select (2) Firefox Desktop
  3. run node build
  4. run ./mach run

Troubleshooting Tips

  • If you change your PATH to point to a different version of say Python or Rust you need to rerun ./mach bootstrap to get the build system to pick up the change.

  • If you are seeing this error:

ERROR!!!!!! Could not find artifacts for a toolchain build named macosx64-dump-syms

Try cloning the latest mozilla-central (context: https://discord.com/channels/779097926135054346/801228428115312671/938567563644915713):

  • Make sure you have mercurial installed (brew install hg)
  • Clone mozilla central to sibling directory to this one (cd .. && hg clone https://hg.mozilla.org/mozilla-central/)
  • Go into the freshly cloned mozilla-central repo and run ./mach bootstrap within it and select (2) Firefox Desktop when prompted. Come back to this repo and try building again.
  • In some cases, even if ./mach bootstrap fails with the above error, the build step might still work, so you can also try building without necessarily getting ./mach bootstrap to complete everything successfully.

You can also find some conversation of these steps at #745

Merging from upstream

  1. Checkout the release branch, pull from upstream release branch:
git checkout release
git pull https://github.com/mozilla/gecko-dev.git release
  1. Switch to a new branch, merge from the release branch.
git checkout webreplay-release
git checkout -b replay-merge
git merge release
  1. Fix merge conflicts.
  2. Fix build breaks.
  3. Make sure the output binary is replay and not firefox.
  4. Get e2e tests etc. to pass.
  5. At this point it is reasonably safe to merge into the webreplay-release branch.
git checkout webreplay-release
git merge replay-merge
git push
  1. Update User Agent version reported by CurrentFirefoxVersion() in toolkit/recordreplay/ProcessRecordReplay.cpp
  2. Make sure automatic updates work with the new browser. Run the build/test action on the merge branch, delete the noupdate file for the build in S3, then launch the browser, open "About Replay" and see if it updates.

Tips for debugging:

  • Look at the update server logs to make sure requests are being processed correctly.
  • Set the app.update.log browser config when running, and then check console output.
  • If there is a line like *** AUS:SVC readStatusFile - status: failed: 23, path: /path/to/update.status, this is produced by the C++ updater which can be found in UpdateThreadFunc in updater.cpp. Building a local browser with instrumentation is likely needed to investigate.
  1. Run live test harness and make sure crash rate is acceptable.

Miscelleneous

Speeding up oh-my-zsh

git config --add oh-my-zsh.hide-status 1
git config --add oh-my-zsh.hide-dirty 1

gecko-dev's People

Contributors

arai-a avatar archaeopteryx avatar bakulf avatar bavariantomcat avatar bhackett1024 avatar bholley avatar bzbarsky avatar daogottwald avatar dbaron avatar dholbert avatar ehsan avatar emilio avatar gijsk avatar glandium avatar jandem avatar jfkthame avatar jonco3 avatar jswalden avatar kmaglione avatar kwierso avatar masayuki-nakano avatar mattwoodrow avatar moz-wptsync-bot avatar ms2ger avatar mstange avatar nnethercote avatar philor avatar rocallahan avatar rvandermeulen avatar staktrace avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gecko-dev's Issues

Show screenshots when mousing over timeline

The timeline is useful for seeking to messages on it and giving users a sense of where they are in the recording, but a lot more improvements are possible. One that seems especially important is to allow users to use the timeline to see screenshots from anywhere in the recording, just by mousing over that part of the timeline. Clicking on the timeline would take users to that point of the recording to inspect DOM/CSS, and maybe the buttons on the side of the timeline could be used to move through the recording frame-by-frame. I think this would be very handy in a variety of situations, but especially so for users viewing someone else's recording (they can see everything that happened on the page by mousing over the timeline) and for inspector users wanting to inspect state during a user interaction (which I find to be very difficult with existing tools).

Show recently viewed recordings in about:webreplay

about:webreplay shows recordings which the user has saved to the cloud, but if they get a recording from someone else and view it then it would be nice to put that in about:webreplay as well in a 'recently viewed recordings' section.

Handling breakpoint hits immediately when recording

If a breakpoint is hit while recording, we have to bring a replaying process to the same point and pause it instead, which can be a delay of several seconds even on simple recordings. This is a major area where performance with web replay is worse than with a normal debugger, and it would be good to investigate fixing this. We could pause the recording process at the point instead, which would happen immediately. Because the pause can interact with the recording we would need to pause any replaying processes in the same place and perform the same actions at that point, but that shouldn't be super complicated.

Style sheets should have a lifetime outside of a specific pause

Style sheets are treated by the inspector in similar ways to how sources are treated by the debugger: they are added once and persist between pauses. Right now proxies representing style sheets can only be accessed while paused at the place where they were generated. This should be fixed so we have a persistent representation of style sheets which will interoperate better with the inspector code. The stack below shows a failure from this issue.

[Control 19.78] ReplayInspector Server Error: Error: Assertion Failed! Stack: ThrowError@resource://devtools/server/actors/replay/module.js line 7 > Function:99:17
assert@resource://devtools/server/actors/replay/module.js line 7 > Function:88:15
getProxyData@resource://devtools/server/actors/replay/module.js line 7 > Function:3054:9
hasRulesModifiedByCSSOM@resource://devtools/server/actors/replay/module.js line 7 > Function:3124:55
hasRulesModifiedByCSSOM@resource://devtools/server/actors/stylesheets.js:368:27
get canSetRuleText@resource://devtools/server/actors/styles.js:1226:26
getAuthoredCssText@resource://devtools/server/actors/styles.js:1584:9
getApplied@resource://devtools/server/actors/styles.js:602:18
asynchandler@resource://devtools/shared/protocol/Actor.js:154:37
onPacket@resource://devtools/server/debugger-server-connection.js:378:58
receiveMessage@resource://devtools/shared/transport/child-transport.js:66:16
MessageListener.receiveMessage
_addListener@resource://devtools/shared/transport/child-transport.js:40:14
ready@resource://devtools/shared/transport/child-transport.js:57:10
_onConnection@resource://devtools/server/debugger-server.js:450:15
connectToParent@resource://devtools/server/debugger-server.js:331:17
onConnect<@resource://devtools/server/startup/frame.js:62:35
exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:111:22
MessageListener.receiveMessage*@resource://devtools/server/startup/frame.js:92:23
@resource://devtools/server/startup/frame.js:174:5

Center replaying content when smaller than the viewport

If the viewport which was used to make a recording is smaller than the viewport which is replaying the recording, the recorded content is shown in the upper left with white margins around it. It would be cleaner if the recorded content was centered in the viewport, and that the margins are shaded to make it clearer that they do not contain web content.

Include uncaught errors / rejections in logs

Errors that occur in parent and middleman processes should be included in logs, to help with identifying and fixing errors. Content never runs in either of these processes, so these errors will not contain user information.

Capture logs from recording processes

Currently we only log data from the UI, middleman, and replaying processes. Recording processes can have important log data as well, in particular errors in the replay JS pulled down from the cloud. Plumbing should be added to send out this data in the same manner as the UI/middleman data.

Color code timeline messages

It might be nice to color code errors, console messages, logpoints, and other kinds of execution points that can be shown on the timeline. It's definitely possible to go overboard here --- allowing users to change the color used for different logpoints might help, or might make things confusing. Regardless, some experimentation here would be nice to see if this is a good approach.

Show indicator when viewing the inspector while unpaused

For several technical reasons the inspector does not show anything when unpaused. This can be confusing for users used to seeing the DOM in the inspector update as the page executes. To help with this it would be nice if a screen was shown in the inspector when not paused, which makes it clear why the DOM isn't being shown and how to fix that (press the pause button next to the timeline, or maybe have a big pause button in the inspector itself).

Replace about page

The about page (Web Replay -> About Web Replay) needs to be updated to use Web Replay imagery and content.

Simplify browser toolbar

The browser toolbar is the primary UI surface area that users will interact with

  • left navigation should feel comfortable
  • right actions should be as usable as possible
    • it should be easy to start a recording
    • it should be easy to upload a recording

figma
simplified toolbar

Polish app installation process

When installing the Web Replay app the screen where the user drags the app to the applications folder is pretty rough, and should be clean and easy to use like other macOS apps.

Allow zooming the timeline

I think this might be possible with the current UI but I don't know how to do it, and whether it is currently possible or not it would be nice if there were elements of the UI which could be used to zoom in to parts of the timeline, or zoom back out. This would make it a lot easier to deal with the timeline when the recording is long or when there are a lot of messages on it.

Remove toolbar clutter

I've already removed some toolbar buttons that are shown in a normal firefox browser, but the toolbar still has too much clutter. The following buttons should be removed:

Home button - This doesn't seem so important these days (I never click on it) and distracts from the recording button next to it.

Bookmarks/history button - This is pretty minor and I don't think people using this browser will be super interested in it.

Sidebar button - Ditto.

Fix startup crash inside Thread::WaitNoIdle

A startup crash at an apparently null IP was seen while reviewing logs. Backtrace info:

Backtrace #0: __ZN7mozilla12recordreplay6Thread4WaitEv+474
Backtrace #1: __ZN7mozilla12recordreplay17HitEndOfRecordingEv+191
Backtrace #2: __ZN7mozilla12recordreplay21RecordingEventSectionC2EPNS0_6ThreadE+173
Backtrace #3: _RecordReplayInterface_InternalRecordReplayValue+149
Backtrace #4: __ZN7mozilla12recordreplay6Thread13BindToCurrentEv+299
Backtrace #5: __ZN7mozilla12recordreplay6Thread10ThreadMainEPv+41

Allow modifying CSS while paused

It should be possible to modify the page's CSS and see the effect on the screen, even when paused somewhere in the recording. This is an important feature of the regular inspector, and when using web replay this should work similarly well. Any changes made to the page layout won't carry over when unpausing and repausing somewhere else, but if the CSS changes could be packed up (there might be functionality for this already) and then reapplied when repausing we could get something similar, and even apply those changes at all paints in the recording so that users can see the result of the changes they make when using the screenshot scrubber on the timeline.

Improve timeline message tooltip

Timeline messages show the script location when moused over, but it would be nice if there was more information shown, including the message text. This might be better done with a doorhanger than a tooltip.

Incorporate new logo into browser

A logo for web replay should be ready soon, and the icons and other imagery in the browser need to be updated to not use the default unbranded nightly images.

Investigate applying updates using binary patches

It would be nice to be able to deliver updates to users very quickly. If changes are limited to cloud software (including the control/replay JS downloaded to the user's machine from the cloud) then we can already do this, but it would be nice to have a way to deliver updates to the user's binaries or other files in the downloaded DMG without forcing them to redownload another DMG. If we could use this to ensure that users viewing recordings are on the latest and greatest build then it will simplify versioning issues a lot in the interaction between the user and the cloud.

I don't think firefox can deliver updates via binary patches but I think that chromium can. Since we need our own update channel anyways it seems like delivering updates as binary patches could be part of that.

Show indicator when paint data might not be correct

After the changes in cd5cf44, when an external call is being performed and there isn't information in the recording about how to do it, dummy values (generally zero, though not necessarily) are filled in for the outputs. This can cause the page to render improperly, and while this should be rare, it would be good to show an indicator on the tab when it is the case so that users will not be nearly as confused by the unexpected output.

New tab shows wrong page

The initial version of web replay compiled against mozilla-central has a default homepage of google.com and shows blank pages on new tab. The new gecko-dev branch is showing the default firefox new tab page, which has firefox specific stuff in it we don't want. The latter needs to be fixed to match the former.

Add user authentication

Right now there is no concept of a user to the web replay browser. Anyone is allowed to upload recordings, and anyone is allowed to view a recording if they have the link (recording links have a UUID which the user would need to know, but those are fairly easy to leak).

Going forward, we need more options in this space. Users need to be able to login in order to view recordings (maybe we can just tie this to a github account, which is I believe what Pernosco does). Users will not need to login in order to make and submit recordings, but if they are logged in we can use that info to let users optionally limit the set of users allowed to view created recordings.

Dependent issues for various things here will be created once the plan is more fleshed out.

Can't upload recordings locally

My local build cannot upload recordings.

This is because the build is not in the cloud, which is understandable, but worth filing

Add payment mechanism

The payment strategy is yet to be determined, but except for a free trial users will need to pay for a subscription in order to view recordings (the plan for now is to allow submitting recordings for free, which doesn't require a login). Some sort of payment processing system will be needed for this.

Make it easier to navigate around a frame using the mouse

There is already a way to jump between different statements in a frame using the mouse (right click -> Continue To Here, maybe some other way too, not sure). This isn't very discoverable and it would be nice to improve the source tab UI when paused in a frame so this navigation is easier. We should be trying to lure users away from the stepping buttons (and regular breakpoints, but that's a separate issue) when possible. There are a couple things here:

  • Statements in the frame which are executed should be shown differently from statements which don't execute. I think that graying out code which doesn't execute and/or making it non-interactive to hover actions would work well.

  • Hovering over a statement which does execute should show a jump icon somewhere, like we do with console messages. I think the icon would work well in any whitespace to the left of the executed statement. We probably can't show it when there isn't any such whitespace, but that should be pretty rare.

Disable CSS source maps when replaying

There have been frequent failures when style sheets are being fetched while the debugger isn't paused. Fetching style sheets requires information about the DOM, and we only allow the DOM to be fetched when the debugger is properly paused (it has paused and isn't about to resume). Looking through the source, I think this is happening because the source map service is fetching the style sheets when it starts up, presumably so it can perform source mapping on CSS files.

We do want to support source maps, but our handling of them isn't great right now --- the service only fetches the most recent source map, while we want to be able to retain/fetch source maps for the version of the code that was running while replaying. Until our handling here improves I think the best thing here is to disable fetching style sheets in the source map service.

Gather/process crash reports

Crash reports are either not being sent out, or are being sent to a mozilla server. The browser needs to be updated to send crash reports to a web replay address, and we need to be able to process them in the backend.

Add filters to about:webreplay for always-recorded sites

Users who are doing QA will generally want to always record certain sites they are visiting. If there was a way in about:webreplay to set filters for sites which are always recorded, this workflow would be a lot more efficient vs. having to manually start recording every time.

Improve initial loading experience

loading about:webreplay?recording={976ef176-79db-9045-a837-871449242288} takes ~9 seconds for me.

It would be good to bring that time down to ~1 second or introduce a loading animation similar to the profiler

Fix message pump recording mismatch

Seen while looking at logs, with libevent code on the stack:

FatalError: Event Mismatch: Recorded sendmsg Replayed kevent

This probably indicates that an IPDL message is being sent differently while replaying than while recording. This isn't enough by itself to see what's going on, but we can add diagnostic record/replay asserts and start tracking the problem down. We'll want to leave the diagnostics in, this isn't the first time that non-deterministic behavior has caused messages to be sent differently in the replay.

Improve experience using recording links

Links to recordings currently look like about:webreplay?recording=some-uuid. These load correctly when using the web replay browser, but there are some remaining issues:

  • These don't look like URLs to pages or apps that can automatically convert URLs into links, which makes them harder to work with.

  • If the user opens one of these links in another browser, it won't recognize the link and will take them to some random google search page or something, which probably won't be helpful for the user in figuring out the problem.

I think that both of these problems could be fixed by having a page on webreplay.org or webreplayaws.org and including it in recording links, like https://webreplay.org/view-recording?id=UUID. This page would need to determine whether the user is using a web replay browser (maybe by sniffing the UA string, though we make that look like a regular firefox UA for now). If so it rewrites the URL to the about:webreplay one (which has the chrome logic needed to connect the tab to the cloud server), and if not it shows a help page describing what the user needs to do to view the recording.

Allow creating and submitting recordings from the command line

There is already functionality for creating recordings of all content processes using a command line option, and saving them to the local disk. This should be extended to allow automatically submitting and logging cloud recordings as well, which should make it easier to integrate with CI services.

Add doorhanger on recording button when first starting up

The new recording button UX is pretty good and easy to use I think, but if a user starts up the browser for the first time and doesn't notice it then they'll be pretty lost. This button needs to be easy to use for anyone, including non-technical users who downloaded web replay to reproduce a bug for a developer. It would be good to add a doorhanger to the button to make it really obvious when first starting up the browser.

Remove ability to perform external calls on another machine

When a replaying process has diverged from the recording and wants to make a call which we don't know how to resolve, we try to perform that call on the user's machine instead. This is problematic for several reasons:

  • If the user is running a different OS than the one the recording was made on, their machine can't perform the call. This will be a headache when we start supporting other OS'es besides macOS. We could use a cloud server running the right OS, but that is a lot of bother and expense without much payback.

  • External calls are performed synchronously, and having to perform many of them over a network connection could be incredibly slow even in non-pathological cases.

  • Bugs in the external call system can crash the middleman process on the user's machine, bringing down the replay without any chance for crash recovery.

The external call improvements from december should help greatly in reducing the number of external calls made, and I'm hoping we can eliminate the need for them in almost all cases. In places where they are still needed (the user is rendering gfx while replaying that never occurred while recording) we might end up showing some black boxes or something for text that couldn't be rendered, but that seems like it will be ok.

Recover from startup crashes

There have been a number of startup crashes seen recently. While it would be nice if these were all fixed, it would be better if the crash recovery mechanism could deal with replaying processes that crash before they fork. If we just start up another remote process it probably won't crash.

Show mouse position / interaction on screen.

Similar to other screen capturing tools, it would be nice if the original mouse position was shown on the screen when replaying recordings, with an indicator when it was recently clicked. The click indicator should work well both when scrubbing the timeline or when paused at a scripted location, which might require a little finesse.

Do a better job when external calls can't be performed

After the changes in cd5cf44, we use dummy (generally zero) values for the outputs of external calls whose outputs we couldn't find in the recording. External calls are mainly used for rendering fonts and widgets, and this can lead to text or widgets missing in the rendered output or being rendered as black boxes. After #49 we'll show an indicator in this case, but it would be good if this wasn't so distracting and we showed something very similar at least to what the real output would be. We could look through the recording for similar calls whose outputs we could use, or we could perform some limited emulation of these calls on the host linux system.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.