Compare commits
2
Commits
5f67725a60
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9bd95c6fa5 | ||
|
|
0a53bbd942 |
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
// app.js - Logic for Magnetflix Page
|
// app.js - Logic for Magnetflix Page
|
||||||
const browserAPI = window.browser || window.chrome;
|
const browserAPI = typeof browser !== "undefined" ? browser : (typeof chrome !== "undefined" ? chrome : null);
|
||||||
|
|
||||||
// State
|
// State
|
||||||
let selectedMovie = null;
|
let selectedMovie = null;
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// Background script for Magnetflix extension
|
// Background script for Magnetflix extension
|
||||||
const browserAPI = window.browser || window.chrome;
|
const browserAPI = typeof browser !== "undefined" ? browser : (typeof chrome !== "undefined" ? chrome : null);
|
||||||
|
|
||||||
// Listen for messages from content scripts and popups
|
// Listen for messages from content scripts and popups
|
||||||
browserAPI.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
browserAPI.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||||
|
|||||||
+13
-7
@@ -1,6 +1,6 @@
|
|||||||
// Content script for Magnetflix: intercepts magnet links and displays popup modal
|
// Content script for Magnetflix: intercepts magnet links and displays popup modal
|
||||||
(function () {
|
(function () {
|
||||||
const browserAPI = window.browser || window.chrome;
|
const browserAPI = typeof browser !== "undefined" ? browser : (typeof chrome !== "undefined" ? chrome : null);
|
||||||
let activeModalHost = null;
|
let activeModalHost = null;
|
||||||
|
|
||||||
// Helper to extract display name from magnet link
|
// Helper to extract display name from magnet link
|
||||||
@@ -330,14 +330,20 @@
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
// Inform background script of captured magnet
|
|
||||||
browserAPI.runtime.sendMessage({
|
|
||||||
action: "magnet_captured",
|
|
||||||
magnet: href
|
|
||||||
});
|
|
||||||
|
|
||||||
// Show popup modal on the page
|
// Show popup modal on the page
|
||||||
showMagnetModal(href);
|
showMagnetModal(href);
|
||||||
|
|
||||||
|
// Inform background script of captured magnet
|
||||||
|
if (browserAPI && browserAPI.runtime && browserAPI.runtime.sendMessage) {
|
||||||
|
try {
|
||||||
|
browserAPI.runtime.sendMessage({
|
||||||
|
action: "magnet_captured",
|
||||||
|
magnet: href
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.warn("Magnetflix: Could not notify background script:", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Generated
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
version = 1
|
version = 1
|
||||||
revision = 3
|
revision = 5
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
resolution-markers = [
|
resolution-markers = [
|
||||||
"python_full_version >= '3.14'",
|
"python_full_version >= '3.14'",
|
||||||
@@ -48,11 +48,11 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "certifi"
|
name = "certifi"
|
||||||
version = "2026.7.22"
|
version = "2026.10.23"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112, upload-time = "2026-07-22T03:35:12.644Z" }
|
sdist = { url = "https://files.pythonhosted.org/packages/fd/11/b524cbd9bbdaca58608e4cf4053fd463417549e1959fa8d3aa18319f9555/certifi-2026.10.23.tar.gz", hash = "sha256:a9895e6e2758b371e0545e321a3a8fd1fcfd9829ada8824a936dfb16aaaf36cd", size = 136225, upload-time = "2026-10-23T11:36:16.478Z" }
|
||||||
wheels = [
|
wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" },
|
{ url = "https://files.pythonhosted.org/packages/32/d1/a3652fe2c19134d0d15922177821d863cbd7e842d53a21bbe7e8e3a1b5ac/certifi-2026.10.23-py3-none-any.whl", hash = "sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1", size = 135082, upload-time = "2026-10-23T11:36:14.763Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// popup.js for Magnetflix toolbar popup
|
// popup.js for Magnetflix toolbar popup
|
||||||
const browserAPI = window.browser || window.chrome;
|
const browserAPI = typeof browser !== "undefined" ? browser : (typeof chrome !== "undefined" ? chrome : null);
|
||||||
|
|
||||||
const SAMPLE_MAGNET = "magnet:?xt=urn:btih:1234567890abcdef1234567890abcdef12345678&dn=Perfect.Blue.1997.1080p.BluRay.x264";
|
const SAMPLE_MAGNET = "magnet:?xt=urn:btih:1234567890abcdef1234567890abcdef12345678&dn=Perfect.Blue.1997.1080p.BluRay.x264";
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user