summaryrefslogtreecommitdiffstats
path: root/debian/patches/0004-Use-packaged-JS-and-CSS-resources-instead-of-pulling.patch
blob: e8d4e45f3cbc8323b797bf2000a18534f5c9ac1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From: Uli Heilmeier <uh@heilmeier.eu>
Date: Wed, 6 Dec 2023 10:36:55 +0100
Subject: Use packaged JS and CSS resources instead of downloading them
 https://gitlab.com/wireshark/wireshark/-/issues/19013#note_1682959548

---
 ipmap.html | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

--- a/resources/share/wireshark/ipmap.html
+++ b/resources/share/wireshark/ipmap.html
@@ -2,15 +2,9 @@
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
 <title>Wireshark: IP Location Map</title>
-<link rel="stylesheet" href="https://unpkg.com/leaflet@1.4.0/dist/leaflet.css"
-    integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA=="
-    crossorigin="">
-<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.Default.css"
-    integrity="sha512-BBToHPBStgMiw0lD4AtkRIZmdndhB6aQbXpX7omcrXeG2PauGBl2lzq2xUZTxaLxYz5IDHlmneCZ1IJ+P3kYtQ=="
-    crossorigin="">
-<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.css"
-    integrity="sha512-RLEjtaFGdC4iQMJDbMzim/dOvAu+8Qp9sw7QE4wIMYcg2goVoivzwgSZq9CsIxp4xKAZPKh5J2f2lOko2Ze6FQ=="
-    crossorigin="">
+<link rel="stylesheet" href="file:///usr/share/javascript/leaflet/leaflet.css">
+<link rel="stylesheet" href="file:///usr/share/javascript/leaflet/MarkerCluster.Default.css">
+<link rel="stylesheet" href="file:///usr/share/javascript/leaflet/MarkerCluster.css">
 <!--
 <link rel="stylesheet" href="https://unpkg.com/leaflet-measure@3.1.0/dist/leaflet-measure.css"
     integrity="sha512-wgiKVjb46JxgnGNL6xagIy2+vpqLQmmHH7fWD/BnPzouddSmbRTf6xatWIRbH2Rgr2F+tLtCZKbxnhm5Xz0BcA=="
@@ -43,12 +37,14 @@
 .range-control-input { padding: 0; width: 130px; }
 .range-control-input, .range-control-label { vertical-align: middle; }
 </style>
-<script src="https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"
-    integrity="sha512-QVftwZFqvtRNi0ZyCtsznlKSWOStnDORoefr1enyq5mVL4tmKB3S/EnC3rRJcxCPavG10IcrVGSmPh6Qw5lwrg=="
-    crossorigin=""></script>
-<script src="https://unpkg.com/leaflet.markercluster@1.4.1/dist/leaflet.markercluster.js"
-    integrity="sha512-MQlyPV+ol2lp4KodaU/Xmrn+txc1TP15pOBF/2Sfre7MRsA/pB4Vy58bEqe9u7a7DczMLtU5wT8n7OblJepKbg=="
-    crossorigin=""></script>
+<script>
+var failedLoad=false;
+function loadError() {
+    failedLoad = true;
+    }
+</script>
+<script src="file:///usr/share/javascript/leaflet/leaflet.js" onerror=loadError()></script>
+<script src="file:///usr/share/javascript/leaflet/leaflet.markercluster.js" onerror=loadError()></script>
 <!--
 <script src="https://unpkg.com/leaflet-measure@3.1.0/dist/leaflet-measure.js"
     integrity="sha512-ovh6EqS7MUI3QjLWBM7CY8Gu8cSM5x6vQofUMwKGbHVDPSAS2lmNv6Wq5es5WCz1muyojQxcc8rA3CvVjD2Z+A=="
@@ -372,6 +368,11 @@
 <input type="file" id="file-picker" accept=".json,.html"></label>
 <p id="error-message"></p>
 </div>
+<script>
+    if (failedLoad) {
+        showError("Failed to load leaflet. Please install packages libjs-leaflet and libjs-leaflet.markercluster.");
+    }
+</script>
 <div id="map"></div>
 <!--
     Wireshark will append a script tag (id="ipmap-data" type="application/json")