• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Upload button problems in FF

CTXMedia

Formerly CyclingTribe
#41
Okay, thanks guys. I've only noticed the slow Chrome typing / posting issue since changing this file (I haven't changed any other XF files for quite some time and the forums have all behaved normally in Chrome for months and months), so I'll probably revert back to the latest XF package version of the file and advise FF users of the problem so they are aware and can temp work around it. (y)

Cheers,
Shaun :D
 

cclaerhout

Well-known member
#42
SWFObject is no more needed. Here's the only part of the code taken from SWFObject that fixes the bug, at least on my Firefox version. This part of the code must be added to the file xenforo/js/swfupload/swfupload.min.js (before or after, it doesn't matter):
Code:
$(function() {
   if(!$.browser.mozilla) return;

   var $o = $('<object />').attr('type', 'application/x-shockwave-flash').appendTo($('body'));

   $(window).load(function(){
     $o.remove();
   });
});
Minified version:
Code:
$(function(){if($.browser.mozilla){var n=$("<object />").attr("type","application/x-shockwave-flash").appendTo($("body"));$(window).load(function(){n.remove()})}});
This looks incredibly stupid but it works. This code only injects a fake flash object in the dom when the document is ready then removes this fake object when the window is loaded. This code will only impact Firefox.

Tests protocole:
1) Original JS file
a) Start from a blank browser (no window) => upload file => bug
b) Reload window => upload file => bug
c) Keep window, close browser, reload browser without manually reloading page => upload file => bug
d) Keep window, close browser, reload browser & manually reloading page => upload file => bug
2) Modified JS file
a) Start from a blank browser (no window) => upload file => passed
b) Reload window => upload file => passed
c) Keep window, close browser, reload browser without manually reloading page => upload file => passed
d) Keep window, close browser, reload browser & manually reloading page => upload file => passed
3) Mix mode
m1) Original file - Start from a blank browser (no window) - upload file => bug
m2) Edit file with modified JS - reload - upload file => passed
m3) Revert to original file - reload - upload file => passed (!)
m4) [reverted file] Close window, load window - upload file => passed (!)
m5) [reverted file] Keep window, close browser, reload browser without manually reloading page => upload file => bug
m6) edit file with modified js - reload - upload file => passed
4) Different websites
a) xenforo.com => upload => bug
b) mywebsite (modified js) => upload => passed
c) Back to xenforo.com (mywebsite can be closed or not) => upload => passed(!)
d) Keep window, reload browser => upload => bug

Extra
  • The m3 & m4 steps explain why it sometimes seems to work and sometimes not.
  • the above workaround might also implies that if a page has already a flash object in it, the uploader will behave as expected (this test could be done by adding in a template a flash object - I didn't do it)
  • The last FF update (33.0.3) doesn't fix the initial issue
 
Last edited:
Top