mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-10 09:24:49 +00:00
check for regex errors & misc ui changes
This commit is contained in:
parent
a867a88550
commit
e4f6940ecc
4 changed files with 38 additions and 33 deletions
|
@ -32,9 +32,14 @@ function createStyleList(styles) {
|
|||
|
||||
currentUrl = currentUrl.replace(/(http[s]?:\/\/|www\.)/i, '').toLowerCase();
|
||||
var styleUrl = styles[i].url;
|
||||
var styleUrlRegex = new RegExp('.*' + styleUrl + '.*', 'i');
|
||||
var styleUrlRegex = null;
|
||||
|
||||
if (styleUrlRegex.test(currentUrl)) {
|
||||
try {
|
||||
styleUrlRegex = new RegExp('.*' + styleUrl + '.*', 'i');
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
if (styleUrlRegex && styleUrlRegex.test(currentUrl)) {
|
||||
allMatchingStyles.push({
|
||||
index: i,
|
||||
length: styleUrl.length
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue