Skip to content

Commit 575ff85

Browse files
committed
Add check for latest ver on iOS
1 parent adb197a commit 575ff85

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

.github/workflows/make-rel-ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
xcrun safari-web-extension-converter . --ios-only --force --no-prompt --no-open --bundle-identifier me.octonezd.oldlander
4343
export OL_VERSION=${{steps.manifest.outputs.version}}
4444
cat ../dev/ios/index.html | envsubst > OldLander/OldLander/Base.lproj/Main.html
45-
sed -i 's/MARKETING_VERSION = 1.0;/MARKETING_VERSION = ${{steps.manifest.outputs.version}};/g' OldLander/OldLander.xcodeproj/project.pbxproj
45+
sed -i '' 's/MARKETING_VERSION = 1.0;/MARKETING_VERSION = ${{steps.manifest.outputs.version}};/g' OldLander/OldLander.xcodeproj/project.pbxproj
4646
cp ../dev/ios/ViewController.swift OldLander/OldLander/
4747
- name: Build ipa
4848
working-directory: ./dist/OldLander

dev/ios/index.html

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta
66
http-equiv="Content-Security-Policy"
7-
content="default-src 'self'"
7+
content="default-src 'self' 'unsafe-inline' https://api.github.com"
88
/>
99

1010
<meta
@@ -18,8 +18,24 @@
1818
<img src="../Icon.png" width="128" height="128" alt="OldLander Icon" />
1919
<p>You can turn on OldLander’s Safari extension in Settings.</p>
2020
<p>You have version $OL_VERSION installed</p>
21-
<a href="https://github.com/OctoNezd/oldlander/releases"
22-
>You can check for updates on GitHub</a
23-
>
21+
<p id="updinfo">Checking for latest version...</p>
22+
<a href="https://github.com/OctoNezd/oldlander/releases">
23+
You can check for updates on GitHub
24+
</a>
25+
<script>
26+
const ui = document.getElementById("updinfo");
27+
fetch(
28+
"https://api.github.com/repos/octonezd/oldlander/releases/latest"
29+
)
30+
.then((res) =>
31+
res.json().then((data) => {
32+
ui.innerText = `Latest version is ${data.name}`;
33+
})
34+
)
35+
.catch((e) => {
36+
ui.innerText = `failed to fetch latest version: ${e}`;
37+
});
38+
</script>
39+
<style></style>
2440
</body>
2541
</html>

0 commit comments

Comments
 (0)