Register now and start sharing your code snippets.

Trusted and sensitive email protection with GPG using Gmail with Firefox

Shell Script (Bash) posted 3 months ago by marko

It’s really simple to use GPG to encrypt and/or sign email you send through Gmail.

Generate your private key.

   1  gpg --gen-key

Extract your public key, which you will send to people you need to communicate securely with.

   1  gpg --armor --export marko.haapala@ihatespamaktagon.com > my_public_pgp_key

Install FireGPG and restart the browser. Use GPG in Gmail.

Tagged firefox, gmail, gpg, trusted emails, sensitive emails, firegpg

Restricting memory usage of Firefox cache

Shell Script (Bash) posted 3 months ago by marko

Firefox hogs a lot of memory when using pages using Ajax enabled web pages. I need to restart the browser many times during a day at the office. This hack seems to have fixed that issue.

Open the location about:config, right click and create a new key of integer type.

Key:

   1  browser.cache.memory.capacity

Value:

   1  16384

Tagged firefox

Opening a new tab with Firefox

JavaScript posted 4 months ago by christian

Note that this only works from a Firefox extension:

   1  function openTab(url, focus) 
   2    {
   3      var tab = getBrowser().addTab(url);
   4  
   5      if(focus)
   6      {
   7        getBrowser().selectedTab = tab;
   8      }
   9     
  10      return tab;
  11    }
  12  

Tagged open, tab, firefox

Notes on how to develop a Firefox extension

Plain Text posted 5 months ago by christian

Create a new profile for extension development

http://lifehacker.com/software/firefox/geek-to-live%E2%80%94manage-multiple-firefox-profiles-231646.php

Tweak Firefox configuration for extension development

http://developer.mozilla.org/en/docs/Setting_up_extension_development_environment

Create a skeleton extension

http://ted.mielczarek.org/code/mozilla/extensionwiz/

Extract it to the your project folder, for example:

   1  /home/name/projects/my_extension

Setup Firefox to load your extension

Follow these instructions to configure Firefox to load your extension from /home/name/projects/my_extension: http://developer.mozilla.org/en/docs/Setting_up_extension_development_environment#Custom_code_location http://developer.mozilla.org/en/docs/Setting_up_extension_development_environment#Using_directories_rather_than_JARs

Install the Extension developer

http://ted.mielczarek.org/code/mozilla/extensiondev/

Start Firefox with the development profile

   1  firefox-bin -P development -no-remote

To start the default profile use:

   1  firefox-bin -P THE_PROFILE_NAME -no-remote

Build your extension

http://www.xulplanet.com/

The extension wizard includes a build script, but it might be a good idea to upgrade it to the latest version, which can be found here (including a Windows build script): http://kb.mozillazine.org/Bash_build_script

Gotchas

If you’re on windows and using CygWin, you might get this error:

   1  ./build.sh: line 6: $'\r': command not found
   2  ./build.sh: line 29: $'\r': command not found
   3  ./build.sh: line 40: $'\r': command not found
   4  ./build.sh: line 70: syntax error near unexpected token `$'do\r''
   5  '/build.sh: line 70: `for CHROME_SUBDIR in $CHROME_PROVIDERS; do

The solution is to run the dos2unix command on the *.sh files:

   1  d2u build.sh
   2  d2u config_build.sh

Tagged firefox, extension, development, notes

Disable javascript resizing of Firefox

Shell Script (Bash) posted 7 months ago by marko

There is absolutely not a single developer in the world who knows what size I like my browser, although many people think they do. To prevent resizing of FF make the following steps.

  1. Open browser preferences
  2. Choose “Content”
  3. Choose “Advanced” on the “Enable javascript” preference
  4. Untick “Move or resize existing windows”

Tagged resize, firefox, browser, koon muuttaminen, javascript, fönstrets dimensioner