ci: add safari extension to build script

This commit is contained in:
faroukbmiled
2026-07-25 04:56:34 +01:00
parent 6262b5786f
commit c7f881c1f1
21 changed files with 124 additions and 0 deletions
Binary file not shown.
@@ -0,0 +1,10 @@
{
"extension_name": {
"message": "Open in Instagram",
"description": "The display name for the extension."
},
"extension_description": {
"message": "Opens instagram.com links (profiles, posts, reels, stories, tags) in the Instagram app.",
"description": "Description of what the extension does."
}
}
+41
View File
@@ -0,0 +1,41 @@
// Redirect instagram.com web links into the native app.
// Shipped inside RyukGram as a Safari web extension.
(function () {
if (window.top !== window.self) return;
if (sessionStorage.getItem("__rygOpenedApp")) return;
function urlFromLocation() {
const path = window.location.pathname.split("/").filter(Boolean);
if (path.length === 0) return null;
if (path[0] === "p" || path[0] === "reel") {
const meta = document.querySelector("meta[property='al:ios:url']");
if (meta && meta.getAttribute("content")) return meta.getAttribute("content");
return path[1] ? `instagram://media?id=${path[1]}` : null;
}
if (path[0] === "stories" && path[1]) {
return `instagram://story?username=${path[1]}`;
}
if (path[0] === "explore" && path[1] === "tags" && path[2]) {
return `instagram://tag?name=${path[2]}`;
}
if (path.length === 1) {
return `instagram://user?username=${path[0]}`;
}
return null;
}
function openInApp() {
const target = urlFromLocation();
if (!target) return;
sessionStorage.setItem("__rygOpenedApp", "1");
window.location.href = target;
}
openInApp();
})();
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

@@ -0,0 +1,39 @@
{
"manifest_version": 3,
"default_locale": "en",
"name": "__MSG_extension_name__",
"description": "__MSG_extension_description__",
"version": "1.0",
"icons": {
"48": "images/icon-48.png",
"96": "images/icon-96.png",
"128": "images/icon-128.png",
"256": "images/icon-256.png",
"512": "images/icon-512.png"
},
"background": {
"service_worker": "background.js"
},
"content_scripts": [{
"js": [ "content.js" ],
"matches": [ "*://*.instagram.com/*" ]
}],
"action": {
"default_popup": "popup.html",
"default_icon": {
"16": "images/toolbar-icon-16.png",
"19": "images/toolbar-icon-19.png",
"32": "images/toolbar-icon-32.png",
"38": "images/toolbar-icon-38.png",
"48": "images/toolbar-icon-48.png",
"72": "images/toolbar-icon-72.png"
}
},
"permissions": [ ]
}
+22
View File
@@ -0,0 +1,22 @@
:root {
color-scheme: light dark;
}
body {
width: 220px;
padding: 14px 16px;
margin: 0;
font-family: -apple-system, system-ui, sans-serif;
text-align: left;
}
.title {
font-size: 15px;
font-weight: 600;
}
.subtitle {
margin-top: 4px;
font-size: 12px;
opacity: 0.7;
}
+12
View File
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="popup.css">
<script type="module" src="popup.js"></script>
</head>
<body>
<div class="title">Open in RyukGram</div>
<div class="subtitle">instagram.com links open in the app.</div>
</body>
</html>