diff options
author | Alexander Jacocks | 2024-01-13 14:04:35 -0500 |
---|---|---|
committer | Alexander Jacocks | 2024-01-13 14:04:35 -0500 |
commit | f96fc1e0c0a741d108aba6455cdb5dc5dca47626 (patch) | |
tree | 0191e82557e7caf7c1f617380284cee259d13f1c | |
download | aur-ebay-nativefier.tar.gz |
initial revision
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | PKGBUILD | 55 | ||||
-rw-r--r-- | ebay-nativefier-inject.js | 53 | ||||
-rw-r--r-- | ebay-nativefier.desktop | 11 | ||||
-rw-r--r-- | ebay-nativefier.png | bin | 0 -> 17382 bytes |
5 files changed, 143 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..cb954581b6a5 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,24 @@ +pkgbase = ebay-nativefier + pkgdesc = eBay desktop built with nativefier (electron) + pkgver = 1.0 + pkgrel = 1 + url = https://ebay.com + arch = armv7l + arch = i686 + arch = x86_64 + license = custom + makedepends = imagemagick + makedepends = nodejs-nativefier + makedepends = unzip + depends = gtk3 + depends = libxss + depends = nss + optdepends = libindicator-gtk3 + source = ebay-nativefier.png + source = ebay-nativefier.desktop + source = ebay-nativefier-inject.js + sha256sums = 2f30de271bd1a4bf30a78a27bb3ee4157c4d85858d9387736e4b94fb661581c3 + sha256sums = 81a830762d02021e80dd2978bdc01bd9c2ec02ab16709827fae2feadca39250b + sha256sums = 22ba360d698d9bb8257e91e7360aa0cf669e7e58a512e9b7aa0ee4b0504563d8 + +pkgname = ebay-nativefier diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..f438432d5f40 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,55 @@ +# Maintainer: Alexander JAcocks <alexander@redhat.com> + +pkgname=ebay-nativefier +pkgver=1.0 +pkgrel=1 +pkgdesc="eBay desktop built with nativefier (electron)" +arch=("armv7l" "i686" "x86_64") +url="https://${pkgname%-nativefier}.com" +license=("custom") +depends=("gtk3" "libxss" "nss") +optdepends=("libindicator-gtk3") +makedepends=("imagemagick" "nodejs-nativefier" "unzip") +source=( + "${pkgname}.png" + "${pkgname}.desktop" + "${pkgname}-inject.js" +) +sha256sums=('2f30de271bd1a4bf30a78a27bb3ee4157c4d85858d9387736e4b94fb661581c3' + '81a830762d02021e80dd2978bdc01bd9c2ec02ab16709827fae2feadca39250b' + '22ba360d698d9bb8257e91e7360aa0cf669e7e58a512e9b7aa0ee4b0504563d8') + +build() { + cd "${srcdir}" + + nativefier \ + --name "eBay" \ + --icon "${pkgname}.png" \ + --width "800px" \ + --height "600px" \ + --user-agent "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Chrome/116.0.5845.172 Safari/605.1.15" \ + --inject "${pkgname}-inject.js" \ + --verbose \ + --single-instance \ + --tray \ + "${url}" +} + +package() { + + install -dm755 "${pkgdir}/"{opt,usr/{bin,share/{applications,licenses/${pkgname}}}} + + + _folder=$(ls "${srcdir}" | grep "[Ee][Bb]ay-linux-") + _binary=$(ls "${srcdir}/${_folder}" | grep "[Ee][Bb]ay") + + cp -rL "${srcdir}/${_folder}" "${pkgdir}/opt/${pkgname}" + chmod 0755 "${pkgdir}/opt/${pkgname}" + ln -s "/opt/${pkgname}/${_binary}" "${pkgdir}/usr/bin/${pkgname}" + install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop" + install -Dm644 "${pkgdir}/opt/${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + for _size in "192x192" "128x128" "96x96" "64x64" "48x48" "32x32" "24x24" "22x22" "20x20" "16x16" "8x8"; do + install -dm755 "${pkgdir}/usr/share/icons/hicolor/${_size}/apps" + convert "${srcdir}/${pkgname}.png" -strip -resize "${_size}" "${pkgdir}/usr/share/icons/hicolor/${_size}/apps/${pkgname}.png" + done +} diff --git a/ebay-nativefier-inject.js b/ebay-nativefier-inject.js new file mode 100644 index 000000000000..f1c2cda9a035 --- /dev/null +++ b/ebay-nativefier-inject.js @@ -0,0 +1,53 @@ +const TIME_BETWEEN_INVOCATIONS = 5000; // Time between invocations (ms) +const NUMBER_OF_INVOCATIONS = 5; // Number of invocations + +console.info("Checking time between invocations:", TIME_BETWEEN_INVOCATIONS, ", Number of invocations:", NUMBER_OF_INVOCATIONS); + +let invocationNumber = 0; +for(var number = 0; number < NUMBER_OF_INVOCATIONS; number++) { + setTimeout(function() { + console.info("*****", ++invocationNumber, "******") + console.info("Checking for service worker in navigator..."); + if ("serviceWorker" in navigator) { + console.info("Service worker found in navigator. Checking for unsupported browser message..."); + if (document.querySelector("a[href='https://support.google.com/chrome/answer/95414']")) { + console.info("Checking cache names from service worker..."); + caches.keys().then(function (cacheNames) { + console.info("CacheNames:", cacheNames); + cacheNames.forEach(function (cacheName) { + console.info("Deleting cache", cacheName, "..."); + caches.delete(cacheName).then(function (result) { + console.info("Cache", cacheName, "deleted:", result); + }); + }); + }); + + console.info("Checking service worker registrations..."); + navigator.serviceWorker.getRegistrations().then(function(registrations) { + console.info("Registrations:", registrations); + registrations.forEach(function (registration) { + console.info("Unregistering registration", registration, "..."); + registration.unregister().then(function(result) { + console.info("Registration", registration, "unregistered:", result); + }); + }); + }); + + setTimeout(function() { + document.location.reload(); + }); + } else { + console.info("Unsupported browser message not found."); + } + } else { + console.info("Service worker not found in navigator."); + } + }, number * TIME_BETWEEN_INVOCATIONS); +} + +const electron = require("electron"); +const request = { + property: "spellCheckerEnabled", + propertyValue: true, //Set this property to false to deactivate spell checking +}; +electron.ipcRenderer.send('session-interaction', request); diff --git a/ebay-nativefier.desktop b/ebay-nativefier.desktop new file mode 100644 index 000000000000..14e92f0915d0 --- /dev/null +++ b/ebay-nativefier.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=eBay +Comment=eBay desktop built with nativefier (electron) +Exec=ebay-nativefier +Icon=ebay-nativefier +Encoding=UTF-8 +StartupWMClass=ebay-nativefier-d40211 +Terminal=false +StartupNotify=true +Type=Application +Categories=Network;WebBrowser;Application; diff --git a/ebay-nativefier.png b/ebay-nativefier.png Binary files differnew file mode 100644 index 000000000000..a1cd86d4f1d2 --- /dev/null +++ b/ebay-nativefier.png |