Skip to content
This repository was archived by the owner on Jan 14, 2022. It is now read-only.

Commit 9bb978c

Browse files
author
Viktor Lukashov
committed
feat: use a modern user agent when scrapping a manifest link from PWA sites
This PR solves an issue that the PWA Builder is not able to analyse a PWAs that check the user agent and return a separate stub page for older browsers not supporting PWA.
1 parent 8355ebd commit 9bb978c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/manifestTools/manifestLoader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var constants = require('../constants'),
2020
var manifestCreator = require('./manifestCreator');
2121

2222
// Request settings taken from https://github.com/InternetExplorer/modern.IE-static-code-scan/blob/master/app.js
23+
// Then the user agent is updated to that of a PWA-capable browser
2324
var request = request.defaults({
2425
followAllRedirects: true,
2526
encoding: null,
@@ -28,7 +29,7 @@ var request = request.defaults({
2829
headers: {
2930
'Accept': 'text/html, application/xhtml+xml, */*',
3031
'Accept-Language': 'en-US,en;q=0.5',
31-
'User-Agent': 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)'
32+
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2763.0 Safari/537.36'
3233
}
3334
});
3435

0 commit comments

Comments
 (0)