Skip to content

Commit

Permalink
1.0.1 (24122)
Browse files Browse the repository at this point in the history
- Optimized background.js
  • Loading branch information
MStankiewiczOfficial committed Dec 16, 2024
1 parent 94fa787 commit fcdc725
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Binary file removed out/RedirectTube-1.0.0.xpi
Binary file not shown.
8 changes: 2 additions & 6 deletions src/background.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo) {
detectYT(changeInfo);
});

Expand Down Expand Up @@ -30,13 +30,9 @@ chrome.contextMenus.create({
]
});

chrome.contextMenus.onClicked.addListener((info, tab) => {
chrome.contextMenus.onClicked.addListener((info) => {
if (info.menuItemId === "openInFreeTube" && info.linkUrl) {
let newUrl = "freetube://" + info.linkUrl;
if (newUrl.includes("youtu.be")) {
const videoId = newUrl.split("/").pop();
newUrl = `freetube://https://www.youtube.com/watch?v=${videoId}`;
}
chrome.tabs.update({ url: newUrl });
console.log(newUrl);
}
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 @@
"name": "RedirectTube",
"description": "Open YouTube links in FreeTube",
"author": "Michał Stankiewicz",
"version": "1.0.0",
"version": "1.0.1",
"manifest_version": 3,
"icons": {
"16": "img/icns/normal/16.png",
Expand Down

0 comments on commit fcdc725

Please sign in to comment.