mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-11 01:44:44 +00:00
msic - problems
This commit is contained in:
parent
8147350ce8
commit
aee4df3cc6
4 changed files with 36 additions and 24 deletions
|
@ -2,6 +2,15 @@ var allImgSrc = {};
|
|||
|
||||
//////
|
||||
|
||||
function getCurrentUrl() {
|
||||
var url = window.location.href;
|
||||
if (url.indexOf('?') > 0) {
|
||||
url = window.location.href.split('?')[0];
|
||||
}
|
||||
url = url.substring(0, url.lastIndexOf('/')+1);
|
||||
return url;
|
||||
}
|
||||
|
||||
function getFileExtension(fileName) {
|
||||
var tmpFileName = fileName.split('.').pop();
|
||||
if (tmpFileName.indexOf('?') > 0) {
|
||||
|
@ -76,7 +85,7 @@ function force(contentString) {
|
|||
|
||||
// https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
|
||||
function sanitize(rawContentString) {
|
||||
|
||||
allImgSrc = {};
|
||||
var srcTxt = '';
|
||||
var dirty = null;
|
||||
try {
|
||||
|
@ -229,6 +238,7 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
|
|||
result = {
|
||||
url: getPageUrl(document.title),
|
||||
title: getPageTitle(document.title), //gatPageTitle(document.title),
|
||||
baseUrl: getCurrentUrl(),
|
||||
imgs: allImgSrc,
|
||||
content: getContent(pageSrc)
|
||||
};
|
||||
|
@ -237,6 +247,7 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
|
|||
result = {
|
||||
url: getPageUrl(document.title),
|
||||
title: getPageTitle(document.title),
|
||||
baseUrl: getCurrentUrl(),
|
||||
imgs: allImgSrc,
|
||||
content: getContent(pageSrc)
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue