Archive

Archive for the ‘firefox’ Category

webapp analyzer

November 4, 2014 Leave a comment

Wappalyzer is a browser extension that identifies software on websites.

Screenshot:

125386

It’s very useful to learn about nem Javascript frameworks for instance :)

Categories: firefox, javascript Tags: ,

Firefox is started automatically but it looks corrupted

September 28, 2014 Leave a comment

Problem
On my home desktop I have autologin enabled, i.e. I don’t need to log in manually. Since I always need a terminal and a browser, “konsole” and “firefox” are started automatically. So I just switch on my machine and when I come back 5 minutes later, I’m ready to work.

However, sometimes Firefox doesn’t start normally. It looks strange: some colors are replaced with a different one, fonts are different, tooltips on tabs are plain black (text in tooltips is not visible), etc. If I restart Firefox, it becomes OK. I’m not sure what causes this problem, but my guess is that Firefox is started too quickly. I think it would require some libraries that are not yet loaded when Firefox is started. Then these pieces of software are loaded, that’s why Firefox gets OK after a restart.

Solution
The solution is simple. Don’t start Firefox immediately after the login. Wait some time until everything else is loaded, and start it after. Of course, we still want to start Firefox automatically, not manually. So we need a simple script:

#!/usr/bin/env bash

# /home/jabba/bin/start_firefox.sh
sleep 60    # Wait 60 seconds. You can play with this value.
/usr/bin/firefox &

Then in the Startup Applications, remove “firefox” and add this script instead. Provide the absolute path of the script. Make sure it’s executable. Here is a screenshot of the applications that are started automatically on my machine:

start_firefox

Categories: firefox, ubuntu

Firefox 29: where is the Tools menu?

Problem
User interface has changed drastically in Firefox 29. Where is the File, Edit, View, … Tools, Help menu?

Solution
That menu is hidden by default. You can access it by pressing Alt-T.

Categories: firefox Tags: ,

Firefox: restore your lost tabs

April 30, 2014 Leave a comment

Problem
Over the last 1.5-2 years, I collected 700+ tabs in my Firefox :) Maybe this summer I will have some time to sort them out. However, today when I switched my computer on, all my tabs were gone and I got a clean Firefox instance with one tab only. Hmm… I had a similar problem once and then I installed an add-on called “Session Manager”. In this add-on I made the setting to offer the list of previous sessions upon restart but it didn’t do anything! Damn, how to get back my tab collection?

Solution
In the .mozilla directory there is a file called sessionstore.js that stores — among others — the opened tabs. However, this file was very small, my previous tabs were clearly not in it. Thank God there was a backup copy of this file next to it called sessionstore.bak. It was a big file and the timestamp of the file indicated that it was created 2 days ago when everything was OK with my tabs.

So, how to extract the old tabs from sessionstore.bak?

This is a JSON file, but it’s not pretty printed. I suggest copying this file to somewhere else where you can experiment with it. First, let’s make it readable:

$ python -m json.tool sessionstore.bak > session.json

Now you can open session.json with a text editor. You will find lines with a “url” key, but the number of these rows is huge. I had 731 tabs (that I lost) but this file contained 6500+ URLs. As I noticed, it also contains the URLs of closed tabs. How to extract the URLs of the opened tabs only?

Again, Python came to my rescue. After analyzing the structure of this JSON file, I could extract the tab URLs the following way:

$ python  # version 2.7
>>> import json
>>> f = open('session.json')  # input file
>>> g = open('tabs.txt', 'w')  # output file
>>> d = json.load(f)
>>> tabs = d["windows"][0]["tabs"]
>>> cnt = 0
>>> for t in tabs:
...     print >>g, t["entries"][0]["url"]
...     cnt += 1
>>> cnt
731    # Yeah! All of them are here!
>>> g.close()
>>> f.close()

The URLs of the lost tabs are now in the tabs.txt file.

I didn’t make a script of it but feel free to do it. From now on I will make regular backups of my opened tabs with the URL Lister add-on.

Categories: firefox, python Tags: , , , ,

Remove global menu bar from Firefox (22.0+)

January 17, 2014 Leave a comment

Problem
You managed to disable the stupid global menu in your Ubuntu but Firefox still has this shit. How to get rid of it?

Solution
Type in about:config and change the value of the line ui.use_unity_menubar to false.

Tip from here.

Categories: firefox, ubuntu Tags: ,

Online Security

June 29, 2013 Leave a comment

Read this: The Best Browser Extensions that Protect Your Privacy @lifehacker.

I installed the following extensions:

Categories: firefox, security Tags: ,

GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0′ failed

Problem
Firefox 21.0 on Ubuntu 13.04 drops this error message in the command line: “GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed“. Whenever I want to open a URL from a script, I get this, which is quite annoying. Actually, this is a known bug.

I use Python a lot and when I call “webbrowser.open_new_tab(url)“, I also get this error message.

Workaround
Until it gets resolved, I call firefox directly and redirect the stderr to /dev/null:

firefox -url www.google.com 2>/dev/null

In Python:

def open_url(url):
    #webbrowser.open_new_tab(url)
    os.system('firefox -url "{url}" 2>/dev/null'.format(url=url))
Follow

Get every new post delivered to your Inbox.

Join 73 other followers