diff --git a/extension/chrome/icon-16x16.png b/extension/chrome/icon-16x16.png new file mode 100644 index 0000000..7f26af4 Binary files /dev/null and b/extension/chrome/icon-16x16.png differ diff --git a/extension/chrome/icon-32x32.png b/extension/chrome/icon-32x32.png new file mode 100644 index 0000000..cf7fe7e Binary files /dev/null and b/extension/chrome/icon-32x32.png differ diff --git a/extension/chrome/icon-48x48.png b/extension/chrome/icon-48x48.png new file mode 100644 index 0000000..615849c Binary files /dev/null and b/extension/chrome/icon-48x48.png differ diff --git a/extension/chrome/icon-72x72.png b/extension/chrome/icon-72x72.png new file mode 100644 index 0000000..370fdb9 Binary files /dev/null and b/extension/chrome/icon-72x72.png differ diff --git a/extension/chrome/icon-96x96.png b/extension/chrome/icon-96x96.png new file mode 100644 index 0000000..6d16c65 Binary files /dev/null and b/extension/chrome/icon-96x96.png differ diff --git a/extension/chrome/main.js b/extension/chrome/main.js new file mode 100644 index 0000000..fc6f3d9 --- /dev/null +++ b/extension/chrome/main.js @@ -0,0 +1,30 @@ +// find a container and an open in app link with button +const container = document.querySelector('div[style="text-align: center;"]'); +const openInAppLink = document.querySelector('a[href^="anixart"'); +const openInAppLinkButton = openInAppLink.querySelector("button"); +openInAppLinkButton.style = "margin-top: 0px !important;"; // disable default button margin +openInAppLinkButton.classList = "btn btn-secondary"; // change default button from primary to secondary + +// create a custom footer +const footer = document.createElement("div"); +footer.style = + "display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 20px;"; + +// create and set custom link +const link = document.createElement("a"); +const button = document.createElement("button"); +button.style = "margin-top: 0px !important;"; +button.classList = "btn btn-primary"; +button.textContent = "Открыть в Anix"; + +const url = new URL(window.location.href); +const pathname = url.pathname; +link.href = `https://anix.wah.su${pathname}`; +link.appendChild(button); + +// append link and open in app link to footer +footer.appendChild(link); +footer.appendChild(openInAppLink); + +// append footer to container +container.appendChild(footer); diff --git a/extension/chrome/manifest.json b/extension/chrome/manifest.json new file mode 100644 index 0000000..c7a074d --- /dev/null +++ b/extension/chrome/manifest.json @@ -0,0 +1,24 @@ +{ + "manifest_version": 3, + "version": "1.0", + "name": "Watch on Anix", + "content_scripts": [ + { + "matches": [ + "https://anixart.tv/release/*", + "https://anixart.tv/collection/*", + "https://anixart.tv/profile/*" + ], + "js": [ + "main.js" + ] + } + ], + "icons": { + "16": "icon-16x16.png", + "32": "icon-32x32.png", + "48": "icon-48x48.png", + "72": "icon-72x72.png", + "96": "icon-96x96.png" + } +} \ No newline at end of file diff --git a/extension/chrome/watch-on-anix-chrome.zip b/extension/chrome/watch-on-anix-chrome.zip new file mode 100644 index 0000000..35798db Binary files /dev/null and b/extension/chrome/watch-on-anix-chrome.zip differ diff --git a/extension/firefox/icon-16x16.png b/extension/firefox/icon-16x16.png new file mode 100644 index 0000000..7f26af4 Binary files /dev/null and b/extension/firefox/icon-16x16.png differ diff --git a/extension/firefox/icon-32x32.png b/extension/firefox/icon-32x32.png new file mode 100644 index 0000000..cf7fe7e Binary files /dev/null and b/extension/firefox/icon-32x32.png differ diff --git a/extension/firefox/icon-48x48.png b/extension/firefox/icon-48x48.png new file mode 100644 index 0000000..615849c Binary files /dev/null and b/extension/firefox/icon-48x48.png differ diff --git a/extension/firefox/icon-72x72.png b/extension/firefox/icon-72x72.png new file mode 100644 index 0000000..370fdb9 Binary files /dev/null and b/extension/firefox/icon-72x72.png differ diff --git a/extension/firefox/icon-96x96.png b/extension/firefox/icon-96x96.png new file mode 100644 index 0000000..6d16c65 Binary files /dev/null and b/extension/firefox/icon-96x96.png differ diff --git a/extension/firefox/main.js b/extension/firefox/main.js new file mode 100644 index 0000000..fc6f3d9 --- /dev/null +++ b/extension/firefox/main.js @@ -0,0 +1,30 @@ +// find a container and an open in app link with button +const container = document.querySelector('div[style="text-align: center;"]'); +const openInAppLink = document.querySelector('a[href^="anixart"'); +const openInAppLinkButton = openInAppLink.querySelector("button"); +openInAppLinkButton.style = "margin-top: 0px !important;"; // disable default button margin +openInAppLinkButton.classList = "btn btn-secondary"; // change default button from primary to secondary + +// create a custom footer +const footer = document.createElement("div"); +footer.style = + "display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 20px;"; + +// create and set custom link +const link = document.createElement("a"); +const button = document.createElement("button"); +button.style = "margin-top: 0px !important;"; +button.classList = "btn btn-primary"; +button.textContent = "Открыть в Anix"; + +const url = new URL(window.location.href); +const pathname = url.pathname; +link.href = `https://anix.wah.su${pathname}`; +link.appendChild(button); + +// append link and open in app link to footer +footer.appendChild(link); +footer.appendChild(openInAppLink); + +// append footer to container +container.appendChild(footer); diff --git a/extension/firefox/manifest.json b/extension/firefox/manifest.json new file mode 100644 index 0000000..861b735 --- /dev/null +++ b/extension/firefox/manifest.json @@ -0,0 +1,30 @@ +{ + "manifest_version": 2, + "version": "1.1", + "name": "Watch on Anix", + "description": "Adds a button to watch on Anix.", + "browser_specific_settings": { + "gecko": { + "id": "{8c53d0c2-43ad-4498-b700-290bd2e1030f}" + } + }, + "content_scripts": [ + { + "matches": [ + "https://anixart.tv/release/*", + "https://anixart.tv/collection/*", + "https://anixart.tv/profile/*" + ], + "js": [ + "main.js" + ] + } + ], + "icons": { + "16": "icon-16x16.png", + "32": "icon-32x32.png", + "48": "icon-48x48.png", + "72": "icon-72x72.png", + "96": "icon-96x96.png" + } +} \ No newline at end of file diff --git a/extension/firefox/watch-on-anix-firefox.zip b/extension/firefox/watch-on-anix-firefox.zip new file mode 100644 index 0000000..72d151c Binary files /dev/null and b/extension/firefox/watch-on-anix-firefox.zip differ