Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Замена домена на geekr.vercel.app #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let habra = '/geekr.vercel.app/post/$2/'
// regex here: https://regex101.com/r/JZ46fx
const regex = {
// https://habr.com/ru/post/(493192)(/#comments)
post: /\/(m?\.?habr\.com|habra\.js\.org)\/.+\/([0-9]{1,})(\/?.{1,})?/,
post: /\/(m?\.?habr\.com|geekr\.vercel\.app)\/.+\/([0-9]{1,})(\/?.{1,})?/,

// https://*.habr.com/ru/post
sub_domain: /[^\m]{0,}\.habr\.com\/.+\/([0-9]{1,})(\/?.{1,})/,
Expand All @@ -32,7 +32,7 @@ chrome.webRequest.onBeforeRequest.addListener(
return {redirectUrl: redirect};
},
{
urls: ["*://*.habr.com/*", "*://*.habra.js.org/*"],
urls: ["*://*.habr.com/*", "*://*.geekr.vercel.app/*"],
types: ["main_frame", "sub_frame"]//, "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
},
["blocking"]
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description" : "Extension for open posts from habr.com in habra.vercel.app",
"version": "1.0",
"manifest_version": 2,
"permissions": ["webRequest", "*://*.habr.com/*", "*://*.habra.js.org/*", "webRequestBlocking", "storage"],
"permissions": ["webRequest", "*://*.habr.com/*", "*://*.geekr.vercel.app/*", "webRequestBlocking", "storage"],
"background": {
"scripts": ["background.js"],
"persistent": true
Expand Down