mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-16 00:29:34 -07:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69c050eb8f | ||
|
|
a3e142dade | ||
|
|
28917489bb | ||
|
|
2365a4c0f7 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ws4kp",
|
||||
"version": "5.21.11",
|
||||
"version": "5.21.12",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ws4kp",
|
||||
"version": "5.21.11",
|
||||
"version": "5.21.12",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dotenv": "^16.5.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ws4kp",
|
||||
"version": "5.21.11",
|
||||
"version": "5.21.12",
|
||||
"description": "Welcome to the WeatherStar 4000+ project page!",
|
||||
"main": "index.mjs",
|
||||
"type": "module",
|
||||
|
||||
@@ -6,15 +6,27 @@ import WeatherDisplay from './weatherdisplay.mjs';
|
||||
import { registerDisplay, timeZone } from './navigation.mjs';
|
||||
import * as utils from './radar-utils.mjs';
|
||||
|
||||
// TEMPORARY fix to disable radar on ios safari
|
||||
// TEMPORARY fix to disable radar on ios safari. The same engine (webkit) is
|
||||
// used for all ios browers (chrome, brave, firefox, etc) so it's safe to skip
|
||||
// any subsequent narrowing of the user-agent.
|
||||
const isIos = /iP(ad|od|hone)/i.test(window.navigator.userAgent);
|
||||
const isSafari = !!navigator.userAgent.match(/Version\/[\d.]+.*Safari/);
|
||||
const safariIos = isIos && isSafari;
|
||||
// NOTE: iMessages/Messages preview is provided by an Apple scraper that uses a
|
||||
// user-agent similar to: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1)
|
||||
// AppleWebKit/601.2.4 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.4
|
||||
// facebookexternalhit/1.1 Facebot Twitterbot/1.0`. There is currently a bug in
|
||||
// Messages macos/ios where a constantly crashing website seems to cause an
|
||||
// entire Messages thread to permanently lockup until the individual website
|
||||
// preview is deleted! Messages ios will judder but allows the message to be
|
||||
// deleted eventually. Messages macos beachballs forever and prevents the
|
||||
// successful deletion. See
|
||||
// https://github.com/netbymatt/ws4kp/issues/74#issuecomment-2921154962 for more
|
||||
// context.
|
||||
const isBot = /twitterbot|Facebot/i.test(window.navigator.userAgent);
|
||||
|
||||
const RADAR_HOST = 'mesonet.agron.iastate.edu';
|
||||
class Radar extends WeatherDisplay {
|
||||
constructor(navId, elemId) {
|
||||
super(navId, elemId, 'Local Radar', !safariIos);
|
||||
super(navId, elemId, 'Local Radar', !isIos && !isBot);
|
||||
|
||||
this.okToDrawCurrentConditions = false;
|
||||
this.okToDrawCurrentDateTime = false;
|
||||
@@ -207,7 +219,7 @@ const radarWorker = () => {
|
||||
};
|
||||
|
||||
// register display
|
||||
// TEMPORARY: except on safari on IOS
|
||||
if (!safariIos) {
|
||||
// TEMPORARY: except on IOS and bots
|
||||
if (!isIos && !isBot) {
|
||||
registerDisplay(new Radar(11, 'radar'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user