function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Steve_FinlaySteve_Finlay 

Safari 5

Just installed Safari 5 and now find that the text in the built in visualpage editor is unreadable :(

 

( This is actually with Safari 5 under Windows XP - will try later on my Mac at home, but assume it will be the same. Safari 4 worked fine )

 

 

Best Answer chosen by Admin (Salesforce Developers) 
amorganamorgan
I created a safari extension for myself, but basically I did just this.

Save this into a plain text file named user.css:

#editor #textarea { 
    margin: 0 !important;
    white-space: pre !important;
    word-wrap: normal !important;
}

Under Safari Preferences, Advanced, click on Style Sheet and select the user.css file you saved. The editor should word fine now.

To uninstall, delete the user.css file.

All Answers

Steve_FinlaySteve_Finlay

Just tried Safari 5 under Mac OSX and it has the same problem rendering the visualforce page edit code as Safari 5 under Windows XP.

Jim BoudreauxJim Boudreaux

Same here. I just started using Safari 5 and I have the same problem. I occasionally had the same problem in Safari 4, but it was only with certain pages, now with Safari 5 it happens on every page.

 

This is a more detailed description of what exactly is happening.

In the Page editor, the vf code and the apex code in the Controller editor is being rendered twice, one in the color coded format, and one in grey. The grey is slightly offset from the colored text and is the "actual" text, as in it is the text that is actually selected by the cursor.

For the most part the text is slightly offset giving rise to a blurry effect that is annoying, but workable.

However things get very interesting if your window is smallish and there is a line of text that is longer than the window. In that case the colored text extends beyond the limit of the window as if a horizontal scroll bar were available, which is not. The grey text word wraps underneath the line, causing a much more defined offset in the text below, thus rendering the entire page editor at that point and beyond a huge mess.

Steve_FinlaySteve_Finlay

For now I'm editing my apex and vf code with Eclipse and the Force.com IDE, so that I can continue to use the world's fastest and most innovative browser :)

 

Steve

 

 

TroutcoTroutco

Hope this is fixed soon. Very inconvenient.  

I've also experienced several browser crashes trying to render visualForce pages now. 

 

Any word from anyone at SalesForce when we can expect full compatibility with Safari 5?  (FYI: I'm using Safari 5 on a Mac and experiencing the same issues described above).

 

 

Jim BoudreauxJim Boudreaux

FYI, I  found Firefox for Mac works better as an alternative to Safari 5 for salesforce.

 

That having been said, Firefox has an annoying habit of downloading pdfs when a page is rendered as a pdf as opposed to displaying it as a plug in. This may just be due to my particular settings,  but as far as I can tell I have Acrobat set up as a plug in in FF and it still downloads the pdf every time I save an edit.

 

So now, instead of just using Safari for everything like I used to, I have to develop in Setup in FF and refresh the page in Safari.

 

This is just insane.

Taka ManoTaka Mano

Same on my Mac OS X with Safari 5.

 

With other browsers such as Firefox, Opera, Chrome, VF code is readable although pdf downloading doesn't work good as Jim Said so I can't use "Page Editor" which is very useful for editing VF page.

 

Suppose that if there is plug-in to open PDFs in these browsers, I could use "non-Safari" one until this problem is fixed.

Or  should I downgrade to Safari 4?

 

 

DanielJimenezDanielJimenez

I created a bookmarklet that works around this for now, it's pretty annoying.

 

 

var iframes = document.getElementsByTagName('iframe');
for (var i=0; i < iframes.length; i++) {
	iframe = iframes[i];
	try {
		iframe.contentDocument.getElementById('content_highlight').style.setProperty('visibility', 'hidden');
		iframe.contentDocument.getElementById('selection_field').style.setProperty('display', 'none');
	} catch (e) {
		window.console.log('nope');
	}
};

 

 

TroutcoTroutco

Daniel:

Can you explain exactly how to use the bookmarklet you list below?

 

I'd love to be able to find a workaround so Safari 5 could render this stuff -- and if you've found the answer it would be most helpful.  I'm just not sure what to do with the content you have below.

DanielJimenezDanielJimenez

Just create a bookmark with the address of "javascript&colon;pasteinscriptfromabove"

Jim BoudreauxJim Boudreaux
Excuse me Daniel, but just what the hell are you talking about?
DanielJimenezDanielJimenez
A bookmarklet. What the hell are you talking about?If you create a bookmark in safari 5 with the javascript code above and click that bookmark when you are looking at a VisualForce page editor or similar, it will make it at least semi usable.
Jim BoudreauxJim Boudreaux

See? I knew one of us was going crazy and unfortunately it turned out to be me!

I had no idea you could make bookmarks from javascript. 

Cool, thanks for teaching me something new today!

Jim BoudreauxJim Boudreaux

of course, I have no idea how one would go about creating a bookmark with javascript...

DanielJimenezDanielJimenez
No problem Jim, some Googling will find you a better answer than I can give :).
TroutcoTroutco

Jim.... if you find a simple explanation of how to do this, please share it :-)

DanielJimenezDanielJimenez
I tried typing up exactly what was needed, but the forums html encoded everything and probably would have just made it more confusing.
DanielJimenezDanielJimenez
Also you could just run the JS from the web inspector window under "console".
Jim BoudreauxJim Boudreaux

Meh, I'm just using firefox until someone fixes this. Kind of sucks though because until someone does fix it I can't develop from my iPad. :(

amorganamorgan
I created a safari extension for myself, but basically I did just this.

Save this into a plain text file named user.css:

#editor #textarea { 
    margin: 0 !important;
    white-space: pre !important;
    word-wrap: normal !important;
}

Under Safari Preferences, Advanced, click on Style Sheet and select the user.css file you saved. The editor should word fine now.

To uninstall, delete the user.css file.

This was selected as the best answer
DanielJimenezDanielJimenez
It would be awesome if you shared that extension.
amorganamorgan
Sure, if you guys would donate what it's worth to you.

SFDCEditorFix is here http://www.54.org/alfred/safari/

No restarting of Safari is needed.


DanielJimenez wrote:
It would be awesome if you shared that extension.
Steve_FinlaySteve_Finlay

See an earlier reply by 'amorgan' describing the CSS solution to this issue with Safari 5, no need for a javascript extension.

The CSS option works well for me.

DanielJimenezDanielJimenez

sfinlay wrote:

See an earlier reply by 'amorgan' describing the CSS solution to this issue with Safari 5, no need for a javascript extension.

The CSS option works well for me.


The downside to the CSS solution is that it can potentially effect any site you visit. The Safari Extension is a much, much better solution.
amorganamorgan
The downside to the CSS solution is that it can potentially effect any site you visit. The Safari Extension is a much, much better solution.
That is correct. That's why I personally went the extension route.

Thanks for the donation Daniel. It is much appreciated.