Comment #9 on issue 3411 by griffin....@gmail.com: favicon not shown in diff view
https://code.google.com/p/reviewboard/issues/detail?id=3411

I ran across this issue and found it a little annoying so I thought I would poke at it a bit. From Googling it appears it is indeed a Firefox bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=519028

There is useful discussion and solutions at:

http://stackoverflow.com/questions/2409759/firefox-3-6-9-drops-favicon-when-changing-window-location


I borrowed the one line answer provided by Mottie and inserted it into diffViewerPageView.js, and as far as I can tell it solved the problem in both Firefox 35.0.1 on Windows and 31.3.0 ESR on Linux. It also doesn't seem to break anything in IE 11.0.9600.

I know absolutely nothing about javascript so I don't really understand why this solution works or why it would be preferable to another solution. Given this, I feel more comfortable posting the diff here and will leave it to someone else to publish for review.

diff --git a/reviewboard/static/rb/js/pages/views/diffViewerPageView.js b/reviewboard/static/rb/js/pages/views/diffViewerPageView.js
index 5a6557f..b815510 100644
--- a/reviewboard/static/rb/js/pages/views/diffViewerPageView.js
+++ b/reviewboard/static/rb/js/pages/views/diffViewerPageView.js
@@ -79,20 +79,21 @@ RB.DiffViewerPageView = RB.ReviewablePageView.extend({
         /*
          * If we have "index_header" or a file+line hash in the location,
          * strip it off. Backbone's router makes use of the hash to try to
          * be backwards compatible with browsers that don't support the
          * history API, but we don't care about those, and if it's present
          * when we call start(), it will change the page's URL to be
          * /diff/index_header, which isn't a valid URL.
          */
         if (window.location.hash) {
             window.location.replace('#');
+            $('link[type*=icon]').detach().appendTo('head');
         }

         Backbone.history.start({
             pushState: true,
             hashChange: false,
             root: this.options.reviewRequestData.reviewURL + 'diff/',
             silent: true
         });
     },

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.

Reply via email to