diff --git a/content_script.js b/content_script.js index 533d490..b6ee21e 100644 --- a/content_script.js +++ b/content_script.js @@ -250,6 +250,8 @@ function getArticleDate() { date = document.body.querySelector('[class^="date"]').innerText; if(!date && document.body.querySelector('[class*="-date"]')) date = document.body.querySelector('[class*="-date"]').innerText; + if(!date && document.body.querySelector('[class*="_date"]')) + date = document.body.querySelector('[class*="_date"]').innerText; // Check to see if there is a date available in the meta, if so get it if(!date && document.head.querySelector('meta[name^="date"]')) @@ -275,7 +277,7 @@ function getArticleDate() { } if(date) - return date.replace(/on\s/ig, '').replace(/[<]br[^>]*[>]/gi,' '); // Replace
and "on" + return date.replace(/on\s/gi, '').replace(/(?:\r\n|\r|\n)/gi, ' ').replace(/[<]br[^>]*[>]/gi,' '); // Replace
, \n, and "on" return "Unknown date"; } @@ -370,7 +372,7 @@ function getArticleAuthor() { elem = document.body.querySelector('[class*="author"]'); if(author === null && elem) { - if(elem.innerText.split(/\s+/).length < 5 && elem.innerText.replace(/\s/g,'') !== "") { + if(elem.innerText.split(/\s+/).length < 6 && elem.innerText.replace(/\s/g,'') !== "") { author = elem.innerText; } } @@ -533,11 +535,11 @@ function addArticleMeta() { // Check a couple places for the date, othewise say it's unknown date.innerHTML = editSVG; - dateContent.innerText = getArticleDate(); + dateContent.innerHTML = getArticleDate(); date.appendChild(dateContent); // Check to see if there is an author available in the meta, if so get it, otherwise say it's unknown author.innerHTML = editSVG; - authorContent.innerText = getArticleAuthor(); + authorContent.innerHTML = getArticleAuthor(); author.appendChild(authorContent); // Check h1s for the title, otherwise say it's unknown title.innerHTML = editSVG; @@ -827,7 +829,7 @@ function createSimplifiedOverlay() { } // If there's no text, grab the whole page - if(globalMostPs.textContent.replace(/\s/g, "") === "") + if(globalMostPs != null && globalMostPs.textContent.replace(/\s/g, "") === "") globalMostPs = document.body; // Get the title, author, etc. @@ -870,7 +872,7 @@ function createSimplifiedOverlay() { // If there's no code, format it if(!isPreNoCode) { - elem.innerHTML = elem.innerHTML.replace(/\n\n/g, '

') + elem.innerHTML = elem.innerHTML.replace(/\n/g, '
') } } @@ -997,7 +999,7 @@ function continueLoading() { var isPaused = false, stylesheetObj = {}, - stylesheetVersion = 1.7; // THIS NUMBER MUST BE CHANGED FOR THE STYLESHEETS TO KNOW TO UPDATE + stylesheetVersion = 1.8; // THIS NUMBER MUST BE CHANGED FOR THE STYLESHEETS TO KNOW TO UPDATE // Detect past overlay - don't show another if(document.getElementById("simple-article") == null) { var interval = setInterval(function() { diff --git a/manifest.json b/manifest.json index cde46cc..50565d9 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,8 @@ { "name": "Just Read", - "version": "1.0.1", + "version": "1.0.2", "manifest_version": 2, - "description": "An article formatter for readability. Essentially an attractive and customizable read mode.", + "description": "A customizable read mode extension.", "homepage_url": "https://github.com/ZachSaucier/Just-Read", "offline_enabled": true, @@ -51,7 +51,6 @@ "required-styles.css", "default-styles.css", "page.css", - "dat-gui.js", "options.js", "options.css", "fonts/*" diff --git a/page.css b/page.css index f0ea64b..21f60ea 100644 --- a/page.css +++ b/page.css @@ -9,6 +9,8 @@ top: 0; left: 0; width: 100%; + max-width: 100%; + min-width: 100%; height: 100%; margin: 0;