Skip to content

Commit

Permalink
Merge pull request #29 from DaniloNovakovic/v2
Browse files Browse the repository at this point in the history
v2.4.1 - fixed yt playlist regexp popup suggestion
  • Loading branch information
DaniloNovakovic authored Nov 1, 2018
2 parents 700c9eb + dfdff11 commit 28faf41
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chrome-dynamic-bookmarks",
"version": "2.4.0",
"version": "2.4.1",
"description": "Chrome extension which dynamically updates bookmarks based on the specified regular expression.",
"scripts": {
"dev": "webpack --mode development",
Expand Down
13 changes: 8 additions & 5 deletions src/js/popup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ document.addEventListener('DOMContentLoaded', function() {
if (urlInput) {
urlInput.value = url;
}
if (/youtube\.com\/.*list=\w+/.test(url)) {
const regExpString = url.match(/list=\w+/i);
regExpInput.value = `youtube\.com\/.*${regExpString}`;
if (/youtube\.com\/.*list=[a-z0-9-]+/i.test(url)) {
const regExpString = url.match(/list=[a-z0-9-]+/i);
regExpInput.value = `youtube\\.com/.*${regExpString}`;
} else {
const subUrl = url.match(/^(http[s]?:\/\/)?(.*\/)|(.*$)/);
if (subUrl) {
const regExpString = subUrl[0].replace(/http[s]?:\/\/(www\.)?/, '');
regExpInput.value = `${regExpString.replace(/[.]/g, `\.`)}.*`;
const regExpString = subUrl[0].replace(
/^(http[s]?:\/\/)?(www\.)?/,
''
);
regExpInput.value = `${regExpString.replace(/\./g, `\\.`)}.*`;
}
}
M.updateTextFields();
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Dynamic Bookmarks",
"description": "Chrome extension which dynamically updates bookmarks based on the specified regular expression.",
"version": "2.4.0",
"version": "2.4.1",
"permissions": ["tabs", "bookmarks", "storage"],
"background": {
"page": "background.html"
Expand Down

0 comments on commit 28faf41

Please sign in to comment.