Skip to content

Commit 5c85aa7

Browse files
authored
Merge pull request #16 from Xatta-Trone/add-readmedium.com
added support for read-medium
2 parents a780eba + 1d521a3 commit 5c85aa7

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Or install manually
4545

4646

4747
### Updates
48+
#### 1.4.0
49+
Added support for [https://readmedium.com/](https://readmedium.com/)
4850
#### 1.3.2
4951
Changed logo
5052

@@ -65,3 +67,6 @@ Added support for all medium.com based websites such as:
6567

6668
### 1.0.1
6769
Minor fixed and updates.
70+
71+
### 1.0.0
72+
Initial release.

app.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function runMedium(url) {
109109
); //Set div attributes
110110
a = document.createElement("a");
111111
a.href = `http://webcache.googleusercontent.com/search?q=cache:${url}&strip=0&vwsrc=1&referer=medium-parser`; // Instead of calling setAttribute
112-
a.innerHTML = "Read from Google Cache";
112+
a.innerHTML = "Open in Google Cache";
113113
a.setAttribute(
114114
"style",
115115
"padding:14px 25px; color:white; background: #242424; display:block;text-align:center;"
@@ -118,7 +118,7 @@ function runMedium(url) {
118118

119119
archive = document.createElement("a");
120120
archive.href = `https://archive.today?url=${url}&run=1&referer=medium-parser`; // Instead of calling setAttribute
121-
archive.innerHTML = "Read from Archive";
121+
archive.innerHTML = "Open in Archive";
122122
archive.setAttribute(
123123
"style",
124124
"padding:14px 25px; color:white; background: #242424; display:block; margin-top:10px;text-align:center;"
@@ -135,9 +135,20 @@ function runMedium(url) {
135135
); //Set div attributes
136136
oldAPI.setAttribute("target", "_blank"); //Set div attributes
137137

138+
// add readmedium.com
139+
readMedium = document.createElement("a");
140+
readMedium.href = `https://readmedium.com/${url}`; // Instead of calling setAttribute
141+
readMedium.innerHTML = "Open in Read-Medium";
142+
readMedium.setAttribute(
143+
"style",
144+
"padding:14px 25px; color:white; background: #242424; display:block; margin-top:10px;text-align:center;"
145+
); //Set div attributes
146+
readMedium.setAttribute("target", "_blank"); //Set div attributes
147+
138148
messageEl = createMessageElement();
139149

140150
leftDiv.appendChild(a); // Append the link to the div
151+
leftDiv.appendChild(readMedium);
141152
leftDiv.appendChild(archive);
142153
leftDiv.appendChild(oldAPI);
143154
leftDiv.appendChild(messageEl);
@@ -192,7 +203,7 @@ function createMessageElement() {
192203
// old API
193204
messageEl = document.createElement("div");
194205
messageEl.innerHTML =
195-
"Iframes/gists/embeds are not loaded in the Google Cache proxy. For those, use the Archive.is proxy instead.";
206+
"Iframe/gist/embeds are not loaded in the Google Cache proxy. For those, please use the Read-Medium/Archive proxy instead.";
196207
messageEl.setAttribute(
197208
"style",
198209
"padding:2px 4px; color:#242424; display:block; text-align:left;max-width: 212px;font-size: 0.83em;border: 1px solid black; margin-top:10px; position:relative;"

img/sample2.png

-81.1 KB
Loading

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "Medium parser",
4-
"version": "1.3.2",
4+
"version": "1.4.0",
55
"description": "Unlocks the whole medium article on the go.",
66
"icons": {
77
"16": "img/icon16.jpg",

0 commit comments

Comments
 (0)