Blocking iframes with uBlock Origin?

Discussion in 'other software & services' started by jocooza, Aug 14, 2015.

  1. jocooza

    jocooza Registered Member

    Joined:
    Aug 14, 2015
    Posts:
    4
    Is it possible to always block iframes by using only the uBlock Origin addon in Firefox? I have Javascript disabled by default, but I also want to disable iframes and this is not possible directly in Firefox.
     
  2. gorhill

    gorhill Developer

    Joined:
    Nov 12, 2013
    Posts:
    745
    Location:
    Canada
    Yes, see Blocking mode: medium mode.

    Edit: actually this blocks 3rd-party frames, not 1st-party ones (the real concerns are 3rd-party frames, not 1st-party ones).
     
  3. imdb

    imdb Registered Member

    Joined:
    Nov 2, 2011
    Posts:
    758
    hey there, gor. you the man. thanks for the ublock origin. keep up the good work, man.
     
  4. jocooza

    jocooza Registered Member

    Joined:
    Aug 14, 2015
    Posts:
    4
    Thank you. This is exactly what I wanted. Adding '* * 3p-frame block' to 'My rules' made my clickjacking attempts unsuccesful.

    After experimenting with uBlock I realized that it could replace multiple addons on a group of workstations I maintain. For this to happen uBlock will have to be installed globally in a disk image. I have made a test by extracting the xpi to the directory '/usr/lib/firefox-addons/extensions/uBlock0@raymondhill.net'. When the system image is booted and Firefox is started from the terminal, this message is shown:

    addons.xpi WARN Exception running bootstrap method startup on uBlock0@raymondhill.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIAppShellService.hiddenDOMWindow]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm -> file:///usr/lib/firefox/browser/extensions/uBlock0@raymondhill.net/bootstrap.js :: startup/onReady :: line 64" data: no] Stack trace: startup/onReady()@resource://gre/modules/addons/XPIProvider.jsm -> file:///usr/lib/firefox/browser/extensions/uBlock0@raymondhill.net/bootstrap.js:64 < startup()@resource://gre/modules/addons/XPIProvider.jsm -> file:///usr/lib/firefox/browser/extensions/uBlock0@raymondhill.net/bootstrap.js:97 < XPI_callBootstrapMethod()@resource://gre/modules/addons/XPIProvider.jsm:4638 < XPI_startup()@resource://gre/modules/addons/XPIProvider.jsm:2359 < callProvider()@resource://gre/modules/AddonManager.jsm:221 < _startProvider()@resource://gre/modules/AddonManager.jsm:703 < AMI_startup()@resource://gre/modules/AddonManager.jsm:874 < AMP_startup()@resource://gre/modules/AddonManager.jsm:2514 < AMC_observe()@resource://gre/components/addonManager.js:55 < <file:unknown>

    uBlock is not shown in the toolbar. The buttons 'Show Dashboard' and 'Show Logger' in the Add-ons Manager are blank. After restarting Firefox everything works as expected. Do you have a suggestion why this is happening? The OS is Ubuntu 12.04 and Firefox 40.0.

    One last question. Is it possible to configure uBlock settings like 'I am an advanced user' and adding rules to 'My rules' without using the Dashboard? I have looked in pref.js but uBlock doesn't save anything there.

    Thanks in advance.
     
  5. gorhill

    gorhill Developer

    Joined:
    Nov 12, 2013
    Posts:
    745
    Location:
    Canada
    No clue. I can't reproduce on my side (FF40 or FF43). From the stack dump, it's as if the browser had not properly initialize the environment necessary for bootstrapped addons to be able to initialize themselves.

    All of uBlock's settings are saved into a SQlite file in your home folder, at "~/.mozilla/firefox/[profile name]/extension-data/ublock0.sqlite". There are a few more local settings in `about:config` (search for "ublock0")
     
  6. jocooza

    jocooza Registered Member

    Joined:
    Aug 14, 2015
    Posts:
    4
    Is it possible to configure uBlock settings before the home folder is created?

    I'm trying to add uBlock in a disk image and need to pre-configure the settings before any home folders are avilable. Usually I configure the add-on settings in /etc/firefox/syspref.js and they will automatically be applied when the users home directory is created. However, the only setting I have been able to find for uBlock is "extensions.ublock0.forceLegacyToolbarButton".
     
  7. jocooza

    jocooza Registered Member

    Joined:
    Aug 14, 2015
    Posts:
    4
    I don't know how I could have missed it, but the functionality I wanted was added to uBlock Origin 1.0.0.1 and explained in the release notes:

    https://github.com/gorhill/uBlock/releases/tag/1.0.0.1

    If you want to enable a setting like "I am an advanced user" the following can be added to /etc/firefox/syspref.js:
    Code:
    pref("extensions.ublock0.adminSettings", "{\"userSettings\":{\"advancedUserEnabled\":true}}");
    If a setting is not included in "extensions.ublock0.adminSettings" the default one will be used.

    This add-on is amazing.

    Now I just need to find out how to fix the bootstrap error..
     
Loading...