diff --git a/README.md b/README.md index cf366e9..8e45acf 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ $ npm install nativefier -g ## Usage -Creating an native desktop app for [medium.com](medium.com): +Creating a native desktop app for [medium.com](medium.com): ```bash $ nativefier "http://medium.com" @@ -161,7 +161,7 @@ A template app with the appropriate event listeners and callbacks set up is incl Tested mostly on OSX, but should work for windows and linux. ### Back Button -A back button is intentionally not provided because the tool is designed for single page apps. However, if desired, an executable can built for any url, and simply pressing the `backspace` key will take the user back to the previous page. +A back button is intentionally not provided because the tool is designed for single page apps. However, if desired, an executable can be built for any url, and simply pressing the `backspace` key will take the user back to the previous page. ## Issues diff --git a/src/options.js b/src/options.js index d6a9649..b445870 100644 --- a/src/options.js +++ b/src/options.js @@ -103,7 +103,7 @@ function getTitle(url, callback) { } const $ = cheerio.load(body); - const pageTitle = $("title").text(); + const pageTitle = $("title").text().replace(/\//g, ""); callback(null, pageTitle); }); } @@ -115,7 +115,7 @@ function normalizeUrl(testUrl) { if (!parsed.protocol) { normalized = 'http://' + normalized; } - if (!validator.isURL(normalized, {require_protocol: true})) { + if (!validator.isURL(normalized, {require_protocol: true, require_tld: false})) { throw `Your Url: "${normalized}" is invalid!`; } return normalized;