Advertisement:

Author Topic: (Beta 4 Charter/Public) Firefox 3.1 and the WYSIWYG editor  (Read 3721 times)

Offline LLStarks

  • Jr. Member
  • **
  • Posts: 162
(Beta 4 Charter/Public) Firefox 3.1 and the WYSIWYG editor
« on: September 09, 2008, 03:17:50 PM »
Is there a file I can edit that will allow useragent sniffing of 3.1 so that the rich text stuff works?

Offline Enc0der

  • Jr. Member
  • **
  • Posts: 358
  • Gender: Male
  • I'm a llama!
Re: (Beta 4 Charter/Public) Firefox 3.1 and the WYSIWYG editor
« Reply #1 on: September 09, 2008, 05:50:53 PM »
Firefox 3.1 uses a whole new javascript engine, this is why it's not working.
"faking" the browser version will do nothing.

Offline LLStarks

  • Jr. Member
  • **
  • Posts: 162
Re: (Beta 4 Charter/Public) Firefox 3.1 and the WYSIWYG editor
« Reply #2 on: September 09, 2008, 10:04:53 PM »
Firefox 3.1 uses a whole new javascript engine, this is why it's not working.
"faking" the browser version will do nothing.
Perhaps. But I found a solution.

Quite simple :)

Sources/Load.php

Find
Code: (Lines 1353-1355) [Select]
'is_firefox' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false,
'is_firefox1' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/1.') !== false,
'is_firefox2' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/2.') !== false,

Replace
Code: [Select]
'is_firefox' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Minefield') !== false,
'is_firefox1' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/1.') !== false,
'is_firefox2' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/2.') !== false,
'is_firefox3' => strpos($_SERVER['HTTP_USER_AGENT'], 'Minefield') !== false,

Themes/default/scripts/script.js

Find
Code: [Select]
var is_ff = ua.indexOf("firefox") != -1;
Replace
Code: [Select]
var is_ff = (ua.indexOf("firefox") != -1) || (ua.indexOf("minefield") != -1);
The last change is the only one that's really needed, but it's best to make SMF think that Minefield is Firefox in other places too just in case :)

Works.

Offline Enc0der

  • Jr. Member
  • **
  • Posts: 358
  • Gender: Male
  • I'm a llama!
Re: (Beta 4 Charter/Public) Firefox 3.1 and the WYSIWYG editor
« Reply #3 on: September 10, 2008, 02:12:38 AM »
oh, so SMF simply doesn't even try to load the JS if it doesn't recognize the browser? weird.. why? ::)
Sorry, my bad. I believed the JS was loading but making errors because of the new (and not-yet-finished) engine..

Offline Fustrate

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,474
  • Gender: Male
  • Controller of the rum budget
    • Fustrate on GitHub
    • @Fustrate on Twitter
    • Fustrate
Re: (Beta 4 Charter/Public) Firefox 3.1 and the WYSIWYG editor
« Reply #4 on: September 10, 2008, 02:20:35 AM »
Code: [Select]
'is_firefox3' => strpos($_SERVER['HTTP_USER_AGENT'], 'Minefield') !== false,

I'm guessing over time it'll change to
Code: [Select]
'is_firefox3' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/3.') !== false,?? So for right now, as long as it's not a public release (and therefore still using minefield) it should be
Code: [Select]
'is_firefox3' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/3.') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Minefield') !== false,
Steven Hoffman
Former Team Member, 2009-2012

Offline LLStarks

  • Jr. Member
  • **
  • Posts: 162
Re: (Beta 4 Charter/Public) Firefox 3.1 and the WYSIWYG editor
« Reply #5 on: September 10, 2008, 03:21:28 PM »
That's ridiculous. If IE8 and Opera betas work with the WYSIWYG editor, Firefox 3.1 betas should as well.

Offline Fustrate

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,474
  • Gender: Male
  • Controller of the rum budget
    • Fustrate on GitHub
    • @Fustrate on Twitter
    • Fustrate
Re: (Beta 4 Charter/Public) Firefox 3.1 and the WYSIWYG editor
« Reply #6 on: September 10, 2008, 05:26:50 PM »
It's not SMF's fault - FF3.1 identifies itself as minefield, not firefox.
Steven Hoffman
Former Team Member, 2009-2012