-
Notifications
You must be signed in to change notification settings - Fork 220
Website Compatibility
- View filed GitHub issues with the label
label:compatibility
- File a Firefox Reality-tagged issue on WebCompat (https://mzl.la/fxr)
-
WebCompat.com
- Guide to Contributing
-
Source code for WebCompat Reporter browser extensions
- Browser extensions for Chrome, Firefox, Opera, and Safari that allow users to click on a button in the browser chrome to report a web compatibility issue at WebCompat.com.
- View triaged Firefox Reality (
label:browser-firefox-reality
) issues reported via WebCompat.com
Many websites present different versions of their content depending on the type of device the site believes it is interacting with. Sites typically infer the user's device type based on the string in the User-Agent
HTTP request header, which is a short piece of text passed by the browser to the web server with every HTTP request. (See Firefox's default User-Agent
values.)
- Visit this page to determine the
User-Agent
sent from your browser: http://my-user-agent.com/ - Visit this page to determine the [
navigator.userAgent
]https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID/userAgent) exposed to web pages in JavaScript: https://webxr.sh/info
By default, Firefox Reality presents a User-Agent
string which identifies it as running on a device with VR capabilities. However, some sites may incorrectly present their content in this mode. Firefox Reality allows you to quickly swap between User-Agent
strings that correspond to desktop, mobile, or VR versions of the browser, as follows:
- Go to Settings.
- Choose Display Options.
- Choose an option from the User-Agent Mode setting.
The page will reload with the chosen user agent.
When users report a site that requires a specific User-Agent
string, including sites that require presentation as a non-Mozilla browser, these are incorporated into a list of User-Agent
overrides in the Firefox Reality browser.
The overrides can be found in the source of the codebase in JSON format at app/src/main/assets/userAgentOverride.json
. The first key -> value pair in each entry is a SHA-512 hash of the domain to which the UA override applies -> User-Agent
override string to use for that domain.
Tip: You can generate a hash for a sitename in a bash shell thus:
echo -n 'example.com' | shasum -a 512
Or you can use this online hash generator.
If Firefox Reality encounters a URL that matches https://cdn.delight-vr.com/, it will look up in the override list for an origin, traversing any subdomains, that matches the origin. In other words, a URL request for cdn.delight-vr.com
(hash: 1bf3eb69b1c904a7327d0cb068aee987bb9ab8d79f5a63cc6dc6b961571a5952d745f5f64f3c40c65560aa8a864e5581aca7f7d6f699daaa77951a4097489180
) will use the User-Agent
override value for delight-vr.com
(hash: 14628752378ac2ca5e38083aca63f468e55cdf13a56c075dd6ac8e444dd1d29bdab58f737730c8309a84acf2d21d582cf8e32136d255e2171b09fb861fc19a10
) if cdn.delight-vr.com
does not appear in the override list.
Firefox Reality ships with default Web Extension content scripts to make improvements to such sites as YouTube to provide an optimal user experience for consumption in a VR browser.
app/src/main/assets/web_extensions/webcompat_youtube/
- Added support for automatically upgrading default playback to HD 1440p (PR #1052) (issue #1051)
- Forces default YouTube video playback to HD 1440p or next best available (issue #1051)
- Added initial Web Extension (PR #1047)
- Injects
<meta name="viewport">
to trigger GeckoView’s Android mobile codepath- Forces non-980px with default UA (example) (issue #862)
- Fixes video playback for videos when quality > 1080p https://github.com/MozillaReality/FirefoxReality/issues/1019 (example) (issue #1019)
- Injects
Instructions for testing with Firefox Reality:
-
Launch Firefox Reality.
-
From the tray menu at the bottom, open Settings > Developer Options.
-
Select Enable Remote Debugging.
-
From Android Studio, make changes to the files in
app/src/main/assets/web_extensions/
. -
Press Run > Run 'app', select your device in the list of Connected Devices at the top, and press the OK button.
-
To test the extension, navigate to a webpage (e.g., a YouTube page):
adb shell am start -a android.intent.action.VIEW -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity -d "https://www.youtube.com/channel/UC0XhbNGFvsdU7Vv6S3JbR2w"
-
To test and debug the Web Extension and the page’s JavaScript, use Firefox Reality’s and Firefox desktop’s Remote Debugging (via the WebIDE or
about:debugging
).
-
Launch desktop Firefox, and navigate to this URL:
about:debugging#/runtime/this-firefox
-
Click the checkbox to enable Enable extension debugging.
-
Press the Load Temporary Add-on… button and select the Web Extenstion by selecting its directory in
app/src/main/assets/web_extensions
.