diff --git a/doc/contributing.asciidoc b/doc/contributing.asciidoc index dc52dd9a0..a9e266a1d 100644 --- a/doc/contributing.asciidoc +++ b/doc/contributing.asciidoc @@ -710,6 +710,7 @@ qutebrowser release * Update changelog (remove *(unreleased)*). * Adjust `__version_info__` in `qutebrowser/__init__.py`. +* Consider updating the completions for `content.headers.user_agent` in `configdata.yml`. * Commit. * Create annotated git tag (`git tag -s "v1.$x.$y" -m "Release v1.$x.$y"`). diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 514d30263..b8f5235f4 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -478,46 +478,14 @@ content.headers.user_agent: # 'ua_fetch.py' # Vim-protip: Place your cursor below this comment and run # :r!python scripts/dev/ua_fetch.py - - - "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:53.0) Gecko/20100101 - Firefox/53.0" - - Firefox 53.0 Win8.1 - - - "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 - Firefox/53.0" - - Firefox 53.0 Linux - - - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) - Gecko/20100101 Firefox/53.0" - - Firefox 53.0 MacOSX - - - - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 - (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4" - - Safari Generic MacOSX - - - "Mozilla/5.0 (iPad; CPU OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 - (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1" - - Mobile Safari 10.0 iOS - - - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, - like Gecko) Chrome/58.0.3029.110 Safari/537.36" - - Chrome Generic Win10 - - - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 - (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" - - Chrome Generic MacOSX + like Gecko) Chrome/71.0.3578.98 Safari/537.36" + - Chrome 71.0 Win10 - - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like - Gecko) Chrome/58.0.3029.110 Safari/537.36" - - Chrome Generic Linux - - - - "Mozilla/5.0 (compatible; Googlebot/2.1; - +http://www.google.com/bot.html" - - Google Bot - - - "Wget/1.16.1 (linux-gnu)" - - wget 1.16.1 - - - "curl/7.40.0" - - curl 7.40.0 - - - "Mozilla/5.0 (Linux; U; Android 7.1.2) AppleWebKit/534.30 (KHTML, - like Gecko) Version/4.0 Mobile Safari/534.30" - - Mobile Generic Android - - - "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like - Gecko" - - IE 11.0 for Desktop Win7 64-bit + Gecko) Chrome/71.0.3578.98 Safari/537.36" + - Chrome 71.0 Linux + - - "" + - Use default QtWebKit/QtWebEngine User-Agent supports_pattern: true desc: >- diff --git a/scripts/dev/ua_fetch.py b/scripts/dev/ua_fetch.py index 75ce4c2f7..6547ad5de 100755 --- a/scripts/dev/ua_fetch.py +++ b/scripts/dev/ua_fetch.py @@ -75,42 +75,17 @@ def filter_list(complete_list, browsers): return table -def add_diversity(table): - """Insert a few additional entries for diversity into the dict. - - (as returned by filter_list()) - """ - table["Obscure"] = [ - ('Mozilla/5.0 (compatible; Googlebot/2.1; ' - '+http://www.google.com/bot.html', - "Google Bot"), - ('Wget/1.16.1 (linux-gnu)', - "wget 1.16.1"), - ('curl/7.40.0', - "curl 7.40.0"), - ('Mozilla/5.0 (Linux; U; Android 7.1.2) AppleWebKit/534.30 ' - '(KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', - "Mobile Generic Android"), - ('Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like ' - 'Gecko', - "IE 11.0 for Desktop Win7 64-bit"), - ] - return table - - def main(): """Generate user agent code.""" fetched = fetch() lut = { - "Firefox": {"Win", "MacOSX", "Linux", "Android"}, - "Chrome": {"Win", "MacOSX", "Linux"}, - "Safari": {"MacOSX", "iOS"} + "Chrome": {"Win10", "Linux"}, } filtered = filter_list(fetched, lut) - filtered = add_diversity(filtered) + filtered["empty"] = [('', "Use default QtWebKit/QtWebEngine User-Agent")] tab = " " - for browser in ["Firefox", "Safari", "Chrome", "Obscure"]: + for browser in ["Chrome", "empty"]: for it in filtered[browser]: print('{}- - "{}"'.format(3 * tab, it[0])) desc = it[1].replace('\xa0', ' ').replace(' ', ' ')