Skip to content

Commit

Permalink
Fix Firefox UA pattern
Browse files Browse the repository at this point in the history
Similar to Safari, this differentiates between mobile and
desktop. In #174, we can further improve this by defining
the allowed values for <platform> and <oscpu>, etc.

Closes #171
  • Loading branch information
miketaylr committed Apr 29, 2022
1 parent 609c205 commit 4467d9b
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions compatibility.bs
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,7 @@ AppleWebKit/537.36 (KHTML, like Gecko) Chrome/&lt;<a>chromeVersion</a>&gt;

<h4 id="ua-string-pattern-firefox">Firefox User-Agent pattern</h4>

"<code>Mozilla/5.0 (&lt;<a>platform</a>&gt;; &lt;<a>oscpu</a>&gt; rv:
&lt;<a>firefoxVersion</a>&gt;) Gecko/&lt;<a>geckoVersion</a>&gt;
"<code>Mozilla/5.0 (&lt;<a>firefoxPlatform</a>&gt;; rv: &lt;<a>firefoxVersion</a>&gt;) Gecko/&lt;<a>geckoVersion</a>&gt;
Firefox/&lt;<a>firefoxVersion</a>&gt;</code>"

<div class="example" id="firefox-ua-examples">
Expand All @@ -1013,6 +1012,25 @@ In Firefox on desktop platforms (Windows, macOS, Linux, etc.),
date "<code>20100101</code>". In Firefox on Android, <code>&lt;<a>geckoVersion</a>&gt;</code> is the
same value as <code>&lt;<a>firefoxVersion</a>&gt;</code>.

<code>&lt;<dfn>firefoxPlatform</dfn>&gt;</code> decomposes to the following:

On desktop platforms, "<code>&lt;<a>platform</a>&gt;; &lt;<a>oscpu</a>&gt;</code>".

On Firefox on Android, "<code>&lt;<a>platform</a>&gt;; &lt;<a>deviceCompat</a>&gt;</code>".

<table>
<thead>
<th>Tokens</th>
<th>Description</th>
</thead>
<tbody>
<tr><!-- TODO: consider documenting VR patterns -->
<td><code>&lt;<dfn for=firefox>deviceCompat</dfn>&gt;</code></td>
<td>The string "<code>Mobile</code>", without any leading or trailing spaces.</td>
</tr>
</tbody>
</table>


<h3 id="ua-string-safari">Safari</h3>

Expand Down

0 comments on commit 4467d9b

Please sign in to comment.