Add a new Desktop HP device (large DPR2 screen)

This commit is contained in:
Gaël Métais
2020-10-04 10:09:06 +02:00
parent 2d2da6e939
commit f62e9baa4a
10 changed files with 32 additions and 60 deletions
+9 -44
View File
@@ -17,49 +17,14 @@ var PhantomasWrapper = function() {
var deferred = Q.defer();
var task = data.params;
/*var options = {
// Cusomizable options
'engine': task.options.phantomasEngine || 'webkit',
'timeout': task.options.timeout || 30,
'user-agent': (task.options.device === 'desktop') ? 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) YLT Chrome/27.0.1453.110 Safari/537.36' : null,
'tablet': (task.options.device === 'tablet'),
'phone': (task.options.device === 'phone'),
'screenshot': task.options.screenshot || false,
'wait-for-selector': task.options.waitForSelector,
'cookie': task.options.cookie,
'auth-user': task.options.authUser,
'auth-pass': task.options.authPass,
'block-domain': task.options.blockDomain,
'allow-domain': task.options.allowDomain,
'no-externals': task.options.noExternals,
// Mandatory
'reporter': 'json:pretty',
'analyze-css': true,
'ignore-ssl-errors': true,
'skip-modules': [
'ajaxRequests', // overridden
'domHiddenContent', // overridden
'domMutations', // not compatible with webkit
'domQueries', // overridden
'events', // overridden
'filmStrip', // not needed
'har', // not needed for the moment
'javaScriptBottlenecks', // needs to be launched after custom module scopeYLT
'jQuery', // overridden
'jserrors', // overridden
'lazyLoadableImages', //overridden
'pageSource', // not needed
'windowPerformance' // overridden
].join(','),
'include-dirs': [
path.join(__dirname, 'custom_modules/core'),
path.join(__dirname, 'custom_modules/modules')
].join(',')
};
*/
var viewportOption = null;
if (task.options.device === 'desktop') {
// Similar to an old non-retina Macbook Air 13"
viewportOption = '1280x800x1';
} else if (task.options.device === 'desktop-hd') {
// Similar to a retina Macbook Pro 16"
viewportOption = '1536x960x2';
}
var options = {
@@ -69,7 +34,7 @@ var PhantomasWrapper = function() {
'tablet': (task.options.device === 'tablet'),
'phone': (task.options.device === 'phone'),
'screenshot': task.options.screenshot || false,
'viewport': (task.options.device === 'desktop') ? '1280x800x1' : null,
'viewport': viewportOption,
'wait-for-network-idle': true,
//'wait-for-selector': task.options.waitForSelector,
'cookie': task.options.cookie,