open search, needs real-world testing

This commit is contained in:
ThaUnknown 2021-01-28 15:23:48 +01:00
parent 0d7f6e1fee
commit 0ebafbd005
4 changed files with 14 additions and 3 deletions

View file

@ -686,7 +686,6 @@ function getRSSurl() {
}
}
async function releasesCards(items, frag, limit) {
console.log(items, frag, limit)
let mediaItems = []
for (let l = 0; l < (limit || items.length); l++) {
let i = items[l].querySelector.bind(items[l])

View file

@ -57,8 +57,8 @@ async function loadHomePage() {
homeReleases.innerHTML = ''
homeReleases.appendChild(gallerySkeletonFrag(4))
resolveFileMedia({ fileName: doc.querySelector("item").querySelector("title").innerHTML, method: "SearchName", isRelease: true }).then(mediaInformation => {
let notification = new Notification('A New Episode Was Released!', {
body: `Episode ${mediaInformation.episode} of ${mediaInformation.media.title.userPrefered} Was Just Released!`,
let notification = new Notification(mediaInformation.media.title.userPreferred, {
body: `Episode ${mediaInformation.episode} was just released!`,
icon: mediaInformation.media.coverImage.medium
});
notification.onclick = async () => {

View file

@ -23,6 +23,7 @@
<link rel="icon" href="logo.png">
<title>Miru - Torrent streaming made simple!</title>
<link href="https://cdn.jsdelivr.net/npm/halfmoon@1.1.0/css/halfmoon-variables.min.css" rel="stylesheet" />
<link rel="search" type="application/opensearchdescription+xml" title="Content Search" href="search.xml">
<script>
window.onload = () => {
navigator.serviceWorker.register('sw.js')

11
search.xml Normal file
View file

@ -0,0 +1,11 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http:/www.mozilla.org/2006/browser/search/">
<ShortName>Miru</ShortName>
<Description>Search anime on Miru.</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="32" height="32" type="image/png">/logo.png</Image>
<Url type="text/html" method="get" template="https://miru.moe/app/">
<Param name="anime" value="{searchTerms}"/>
</Url>
<Url type="application/opensearchdescription+xml" rel="self" template="miru"/>
<moz:SearchForm>https://miru.moe/</moz:SearchForm>
</OpenSearchDescription>