tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

loggingKeyboardIME.rst (3839B)


      1 Logging native keyboard and IME event handler behavior
      2 ======================================================
      3 
      4 If you're using 3rd party's IME or keyboard layout and you reported a bug which is reproducible with the IME or keyboard layout,
      5 you may be requested to attach a log file of that how Firefox/Gecko handled the native events coming from your IME or keyboard layout.
      6 
      7 Steps to log the behavior
      8 +++++++++++++++++++++++++
      9 1-1. Logging from startup
     10 -------------------------
     11 If you or contributors in bugzilla request the IME information (mainly on Linux),
     12 you need to enable the logging at launching Firefox.  You need to set 2 environment variables,
     13 one is ``MOZ_LOG``, set it to ``KeyboardHandler:4,IMEHandler:4,sync``, the other is ``MOZ_LOG_FILE``,
     14 set it to a full path to a logging file. With or after setting the environment variables,
     15 launch Firefox normally.
     16 
     17 If you need to reproduce the bug in a specific web site,
     18 you should open the tab and make Firefox restore the tab before doing the following steps.
     19 
     20 Ensure Firefox is completely closed, first.
     21 
     22 If you use Windows, you can set the environment variables with GUI.
     23 However, launching with terminal or commandline is simpler
     24 (replace ``<username>`` with your home folder/directory name):
     25 
     26 Windows (command prompt):
     27 
     28 ::
     29 
     30  set MOZ_LOG=KeyboardHandler:4,IMEHandler:4,sync
     31  set MOZ_LOG_FILE=C:\Users\<username>\firefox-log
     32  start firefox
     33 
     34 Windows (PowerShell):
     35 
     36 ::
     37 
     38  $env:MOZ_LOG = "KeyboardHandler:4,IMEHandler:4,sync"
     39  $env:MOZ_LOG_FILE = "C:\Users\<username>\firefox-log"
     40  Start-Process firefox
     41 
     42 macOS:
     43 
     44 ::
     45 
     46  MOZ_LOG=KeyboardHandler:4,IMEHandler:4,sync MOZ_LOG_FILE=/Users/<username>/firefox-log /Applications/Firefox.app/Contents/MacOS/firefox
     47 
     48 Note: Replace ``Firefox.app`` with ``Firefox\ Beta.app`` or ``Firefox\ Nightly.app`` if you use beta or nightly build.
     49 
     50 Linux:
     51 
     52 ::
     53 
     54  MOZ_LOG=KeyboardHandler:4,IMEHandler:4,sync MOZ_LOG_FILE=/home/<username>/firefox-log firefox
     55 
     56 1-2. Logging only during a test
     57 -------------------------------
     58 If you don't need the IME information which is logged only at startup,
     59 you can use ``about:logging``.
     60 
     61 1. Prepare to do the simplest steps to reproduce, e.g., open a simple test case into a tab.
     62 2. Open ``about:logging`` in a new tab.
     63 3. Set "New log modules" field to ``KeyboardHandler:4,IMEHandler:4,sync`` and type ``Enter`` key.
     64 4. Choose "Logging to a file" radio button below.
     65 5. Set "New log file" field to a full path for log file (see ``MOZ_LOG_FILE`` value of above examples in 1-1) and type ``Enter`` key.
     66 6. Then, **click** "Start Logging" button above.
     67 
     68 2. Reproduce the bug
     69 --------------------
     70 Then, your all inputs via keyboard is now being logged.
     71 
     72 Give focus to somewhere if you need with **mouse** and reproduce the bug with the minimum steps.
     73 
     74 Note: Keyboard operation for preparing to reproduce the bug is also logged and that makes harder to read.
     75 Therefore, keyboard should be used only when you reproduce the bug.
     76 
     77 Warning: In order to avoid leaking private information, do **NOT** do the following kindes of things while testing:
     78 
     79 - Typing private things like email address, passwords, etc.
     80 - Move focus to password fields whose value is already filled by the web site or the password manager.
     81 - Move focus to the URL bar if the URL contains private things like account name, session ID, etc.
     82 
     83 3. Close the Firefox instance
     84 -----------------------------
     85 Then, close Firefox with **mouse**.
     86 
     87 4. Attach the log file to the bug
     88 ---------------------------------
     89 Now, you should find ``firefox-log-main.<process-id>.moz_log`` file which is not empty.
     90 This file is what the developers want.
     91 Let's attach the file to the bug with clicking "Attach New File" button in bugzilla.
     92 
     93 For making the log file easier to read,
     94 explaining what you typed during the test within the comment field is really helpful.