1

Do you know a way to disable any message bar (Google translate, ff help bar question,...) that appears when loading a site page? I have noticed that for some site Google translate is not pop up, although they don't use code as <meta name="google" value="notranslate">? Is there any trick in html code, or is depends of html definition:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

That affect the browser bar?

akluth
  • 8,393
  • 5
  • 38
  • 42
Nina
  • 31
  • 7
  • This was potentially (really unclear due to improper question formulation) already answered [here](http://stackoverflow.com/questions/2980520/how-to-specify-your-webpages-language-so-google-chrome-doesnt-offer-to-transla) and [here](http://stackoverflow.com/questions/7228972/disable-chrome-translation-bar-on-my-website). For a solution to how to prevent your website from displaying within the Google Translate frame (but still offer translations) when using Google Translate service directly, see my possible solution below. – TildalWave Jan 26 '13 at 01:09

2 Answers2

1

Well, if a browser company decide to 'freak-out' or what-ever do something beside showing html content, you can't do anything but try another browser. Like, if googleChrome add publicity to their 'software' .. you'd need to 'hack' the software in order to remove components from it.

Some softwares offer 'web' extensions such has microsoft IE <meta http-equiv="imagetoolbar" content="no"> etc etc..

Search the web for 'browser specific meta', it might help.

carry on

Milche Patern
  • 19,632
  • 6
  • 35
  • 52
  • 1
    Added +1 just to remove that down vote that wasn't given a reason for. ;) Besides, who's to tell what you answered isn't the answer to the question asked? I sure don't understand it LOL – TildalWave Jan 25 '13 at 21:49
1

What you want to do is check that your document is the top-most frame and if not, 'break free' from being displayed in a frame/iframe of another location. Add this code to your documents in the HEAD section:

<script language="JavaScript" type="text/javascript">
<!--
  if (top.location != location) {
    top.location.href = document.location.href ;
  }
-->
</script>

This won't stop Google Translate from displaying translated version of your page, for example, but it will make your document 'break free' out of the frame that Google sets up (with the ability to change a few settings and such). Hope that's what you were looking for. If you have access to your web server configuration, then also check for how to prevent linking in frame and iframe from other domains for your web server. The Apache code for that would be:

#block frame and iframe linking from other domains
Header always append X-Frame-Options SAMEORIGIN

Not sure all browsers respect such headers, though and you might be forced to use mod_rewrite rules to achieve what you're after.

Cheers!

TildalWave
  • 1,677
  • 1
  • 14
  • 20
  • 1
    The question is about messages displayed in the browser chrome, not frames. – Quentin Jan 25 '13 at 20:11
  • @Quentin - with all due respect but the original question is written using such poor English that neither of us can really be sure what was asked. What I gather is the OP wants to get rid of that Google Translate top frame in which translated document is displayed, mentioning some sites work like that with Google Translate and some don't. What I posted answers how to achieve exactly that. If it's not exactly what OP asked for, then please clarify the question first. Thanks! – TildalWave Jan 25 '13 at 20:16
  • I can see how the Google Translate could be understood as talking about frames, but not the Firefox help bar. – Quentin Jan 25 '13 at 20:21
  • That affect the browser bar? – Milche Patern Jan 25 '13 at 20:29
  • @Milche - that 'browser bar' could be pretty much anything and until the OP clarifies the question it might as well mean 'cyber cafe' for all we know. My answer is based on the fact that Google Translate gets mentioned in a way it's (some 'bar') displayed with some websites 'is not pop up', indicating in others it might be. I'm of course assuming 'pop up' isn't really a pop-up either, not knowing of Google displaying pop-ups with translations, but instead a toolbar sitting in an outer frame, and displaying page contents in an inner frame, like Google Translate does. – TildalWave Jan 25 '13 at 20:50
  • @Quentin - OK, it could be what OP meant, but that would only affect Chrome and not any other browsers, and I don't see Chrome specifically named anywhere in the original question asked. I personally thought OP is referring to [this](http://imgur.com/pf9qW5A), which is answered in my post. I could provide an answer to what your understanding of OP's _browser bar_ is, but what's the point, we're all just shooting in the dark... – TildalWave Jan 26 '13 at 01:01
  • Thank you all for replays! At first, I'm sorry for all confused I have made. I'm new in programming and does not deal fully with all terms of IT. I learned something from all of you, thank you. :) – Nina Jan 26 '13 at 21:09