mirror of
https://github.com/responsively-org/responsively-app
synced 2024-09-20 22:31:59 +00:00
include filename in screenshot for html file
This commit is contained in:
parent
83accd35d0
commit
44c7efb0b8
1 changed files with 18 additions and 6 deletions
|
@ -194,11 +194,23 @@ function _getScreenshotFileName(
|
|||
}
|
||||
|
||||
const _getWebsiteName = address => {
|
||||
let domain = new URL(address).hostname;
|
||||
domain = domain.replace('www.', '');
|
||||
const dotIndex = domain.indexOf('.');
|
||||
if (dotIndex > -1) {
|
||||
domain = domain.substr(0, domain.indexOf('.'));
|
||||
|
||||
let domain='';
|
||||
if(address.startsWith("file://")){
|
||||
let fileNameStartingIndex=address.lastIndexOf('/')+1;
|
||||
let htmIndex=address.indexOf('.htm');
|
||||
if(htmIndex==-1){
|
||||
htmIndex=address.length;
|
||||
}
|
||||
domain=address.substring(fileNameStartingIndex,htmIndex);
|
||||
console.log(domain)
|
||||
}else{
|
||||
domain = new URL(address).hostname;
|
||||
domain = domain.replace('www.', '');
|
||||
const dotIndex = domain.indexOf('.');
|
||||
if (dotIndex > -1) {
|
||||
domain = domain.substr(0, domain.indexOf('.'));
|
||||
}
|
||||
}
|
||||
return domain.charAt(0).toUpperCase() + domain.slice(1);
|
||||
};
|
||||
};
|
Loading…
Reference in a new issue