diff --git a/extension/content.js b/extension/content.js index 1ff534a..1a1427a 100644 --- a/extension/content.js +++ b/extension/content.js @@ -1,7 +1,7 @@ function freeUrl(url) { const urlObj = new URL(url) - urlObj.host = "freedium.cfd"; + urlObj.host = "readmedium.com"; return urlObj.href; } diff --git a/extension/manifest.json b/extension/manifest.json index 16730c9..79a4a2f 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "FreeMedium", - "version": "1.0", + "version": "2.0", "description": "An extension to read Medium posts for free.", "icons": { "16": "images/icon-16.png", diff --git a/tests/e2e/e2e.spec.js b/tests/e2e/e2e.spec.js index 0aee81d..6319848 100644 --- a/tests/e2e/e2e.spec.js +++ b/tests/e2e/e2e.spec.js @@ -1,7 +1,6 @@ // @ts-check import { test, expect } from './fixtures'; - const urls = [ 'https://somesubdomain.medium.com', 'https://medium.com', @@ -11,7 +10,7 @@ const urls = [ for (const url of urls) { test(`Button exists in "${url}" page`, async ({ page }) => { const mediumUrl = `${url}/some-post` - const expectedUrl = 'https://freedium.cfd/some-post' + const expectedUrl = 'https://readmedium.com/some-post' await page.goto(mediumUrl); expect(page.locator('button#free-medium__button')).toBeDefined(); diff --git a/tests/unit/freeUrl.test.js b/tests/unit/freeUrl.test.js index 3a8888b..b286b42 100644 --- a/tests/unit/freeUrl.test.js +++ b/tests/unit/freeUrl.test.js @@ -1,7 +1,7 @@ function freeUrl(url) { const urlObj = new URL(url) - urlObj.host = "freedium.cfd"; + urlObj.host = "readmedium.com"; return urlObj.href; } @@ -10,16 +10,16 @@ function freeUrl(url) { describe("freeUrl", () => { it("converts the URLs correctly", () => { expect(freeUrl("https://medium.com/my-post")).toBe( - "https://freedium.cfd/my-post" + "https://readmedium.com/my-post" ); expect(freeUrl("https://www.medium.com/my-post")).toBe( - "https://freedium.cfd/my-post" + "https://readmedium.com/my-post" ); expect(freeUrl("https://some-subdomain.medium.com/my-post")).toBe( - "https://freedium.cfd/my-post" + "https://readmedium.com/my-post" ); expect(freeUrl("https://medium.com/hackernoon/hello-world-79436a73e443")).toBe( - "https://freedium.cfd/hackernoon/hello-world-79436a73e443" + "https://readmedium.com/hackernoon/hello-world-79436a73e443" ); }); });