]> source.dussan.org Git - nextcloud-server.git/commitdiff
Workaround for disappearing app icons for Firefox before version 51 2025/head
authorJulius Haertl <jus@bitgrid.net>
Fri, 4 Nov 2016 13:51:03 +0000 (14:51 +0100)
committerJulius Haertl <jus@bitgrid.net>
Sat, 5 Nov 2016 18:22:13 +0000 (19:22 +0100)
Signed-off-by: Julius Haertl <jus@bitgrid.net>
core/js/js.js

index d2bbbae6362839fcc6f7ed5aa3d335746e018c18..d532b57df6ef71ab12ae9015954d4511050d273a 100644 (file)
@@ -1957,6 +1957,17 @@ OC.Util.History = {
                }
                if (window.history.pushState) {
                        var url = location.pathname + '?' + strParams;
+                       // Workaround for bug with SVG and window.history.pushState on Firefox < 51
+                       // https://bugzilla.mozilla.org/show_bug.cgi?id=652991
+                       var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
+                       if (isFirefox && parseInt(navigator.userAgent.split('/').pop()) < 51) {
+                               var patterns = document.querySelectorAll(selector || '[fill^="url(#"], [stroke^="url(#"]');
+                               for (var i = 0, ii = patterns.length, pattern; i < ii; i++) {
+                                       pattern = patterns[i];
+                                       pattern.style.fill = pattern.style.fill;
+                                       pattern.style.stroke = pattern.style.stroke;
+                               }
+                       }
                        if (replace) {
                                window.history.replaceState(params, '', url);
                        } else {