How to use resizeTo in Safari (if it doesn’t work)

Many people are probably familiar with the fact that most browsers allow Javascript code to be entered in the address field. That’s the magic behind bookmarklets, which simply spare the user the hassle of manually typing long, convoluted and obfuscated Javascript statements.

While it’s usually pointless to do so, there is one case in which it makes perfect sense: resizing the browser window to an arbitrary size, in order to test what a website looks like. Essentially, by setting the browser window to a size such as 1024 x 768, one can have a relatively reliable idea of what the current website would look at that screen resolution. In truth, one would have to take the graphical elements of the operating system in question, but it’s usually a fine way to get an idea.

The code to do so is very simple:
window.resizeTo(width, height);

Therefore, if we want to set the window to 1024 x 768 pixels, we type the following pseudo-address:
javascript:window.resizeTo(1024, 768);

and press enter. A few things worth noting:

  • Capitalization is important. It is resizeTo, with a lowercase “r” and a capital “T”
  • There is no space, nor any slash, after the colon
  • The width and height have to be separated with a comma, and (of course) have to be integers
  • The semicolon at the end is optional, but if you’re a programmer it will be natural to type it
  • In some browsers, you can omit the “window.” part, as the current window is implied

This is all good and great, and works in most browser.

Safari, however, only allows this intermittently. Since I spent some time making tests to figure it out, here is a tip: Safari will execute resizeTo only when there is one (and only one) tab in the window.

I’m not sure whether this is caused by a specific setting on my machines, or if it’s a default, or if it can be even changed, but I can see the point in this behavior. Since some websites have the bad habit of resizing the current window to full screen (an annoying and pointless habit, if you ask me), Safari blocks the execution of such command in order not to disrupt the concurrent navigation of different websites/pages.

It’s as if it said: “if this is your own window, do what you want with it; if not, you’ll have to respect your tab brothers.”

So, if resizeTo isn’t working for you, drag that tab out of the bar so it’s instantly opened in its own window, and try again.

Languages: the strange case of Pirahã and Aymara

In my last post, I wrote about the connections between language and thought, ie. linguistic relativity / determinism.

In today’s highly globalized world, languages get mixed and evolve at a much faster pace than ever before. English, for instance, is no longer only divided into British, American and Australian English; we could say that there is a variety of English for any other natural language: Spanglish, Chinglish and so on. When French was the de-facto lingua franca of diplomacy (and, by extension, of Western Europe), it was not substantially modified by other local languages. When English replaced it, after World War I and especially after World War II, it started changing immediately.

English, especially its American variety, was not only originally used for international diplomacy; rather, as the United States rose a superpower in many fields (technology, business, etc.), one could argue that its language became widespread from the bottom-up. The average Joe in most other Western countries was exposed to American words: they wore blue jeans, they put coins into juke-boxes, they went to a bar. As English words became naturalized over time, this ultimately led to the creation of what could be easily considered a series of creoles that are for the most part mutually intelligible.

Continue reading “Languages: the strange case of Pirahã and Aymara”

Languages: linguistic relativity, words vs. thought

One of the most intriguing concepts in linguistics is the so-called Sapir-Whorf hypothesis, or linguistic relativity principle. Simply put, it states that the language we speak can influence the way we think. Another common name for this theory is linguistic determinism. There are some subtleties in the usage of these different names (no pun intended), but in order to avoid confusing them and giving wrong information, I’ll refrain from attempting. There are many resources online about the details of this topic for those who wish to delve deeper. For the sake of this post, I will freely use the terms interchangeably.

Anybody who studied a foreign language, even without reaching fluency, has most likely had an experience with the linguistic relativity principle. The farther the language in question is different from the native language, the more the phenomenon is obvious.

Continue reading “Languages: linguistic relativity, words vs. thought”