This is AdBlock's old support site. It is available for archival purposes only. To create a new discussion, or to visit the up-to-date knowledge base, please visit help.getadblock.com

Enable blocking on chrome://apps/

Siskin's Avatar

Siskin

15 Jun, 2015 12:42 PM

Yes, chrome://apps/ is a chrome internal page and does not have adds.
Why allow blocking elements on it then? Read below.

Curently Chrome's new tab page is a face slap to users. It exposes frequently visited sites to anyone who glances at your screen.

One possible solution is using "Empty New Tab Page" or "Blank New Tab Page" however that replaces the new tab page with a white page which frankly is ugly as hell and you don't get to see your theme image anymore.

Another better solution is to use "ExtensionNew Tab Redirect" and redirect to chrome://apps/
Then your history is no longer exposed and you get to see your theme image. This is the best compromise at this time, however it is still a compromise.

But if adblock would allow manual filters for elements on this page, we could finally have a blank new tab page with the theme image as background. A dream come true.

  1. Support Staff 1 Posted by Rhana on 15 Jun, 2015 01:25 PM

    Rhana's Avatar

    Hi Siskin,

    Thanks for your suggestion! I've passed this on to our developers.

    If you have any experience in making browser extensions in HTML, CSS, JavaScript, and jQuery, please take a look at code.getadblock.com and send us a patch as an attachment! Our code is licensed under the GNU GPLv3.

    Rhana
    AdBlock Community Manager

  2. Rhana closed this discussion on 15 Jun, 2015 01:25 PM.

  3. Rhana re-opened this discussion on 15 Jun, 2015 01:28 PM

  4. Support Staff 2 Posted by Rhana on 15 Jun, 2015 01:28 PM

    Rhana's Avatar

    Hi again!

    Actually, I forgot to mention that you can try using AdBlock's resource list to help block elements manually.

    1. Click the AdBlock button > Options, and on the "GENERAL" tab select I'm an advanced user, show me advanced options.
    2. Reload the New Tab page.
    3. Click the AdBlock button > Show the resource list. Blocked elements such as ads and page analytics are shown in red text.
    4. Play with blocking elements until you get the result you want.

    Hope this helps!

    Rhana
    AdBlock Community Manager

  5. 3 Posted by Siskin on 15 Jun, 2015 01:39 PM

    Siskin's Avatar

    In the chrome://apps/ tab, adblock is greyed out as if paused, and the only options are "pause adblock", "options" and "hide this button".

    I already tried to manually add the filter chrome://apps/##div[id="footer"]
    However, adblocks throws a:
    The following filter:
    chrome://apps/##div[id="footer"]
    has an error:
    Invalid domain: chrome://apps/

    I'm now tracing the code backwards to find where the testing is done and add an exception for this but finding the right place seems to be no easy feat for my limited web coding skills.

  6. 4 Posted by Siskin on 15 Jun, 2015 01:43 PM

    Siskin's Avatar

    Forum formating changed the filter I wrote, here is a plain text view:
    chrome://apps/##div[id="footer"]

  7. 5 Posted by Siskin on 15 Jun, 2015 01:44 PM

    Siskin's Avatar

    Okay I give up on that lol. replace " with the actual quote sign, shift + '

  8. Support Staff 6 Posted by Rhana on 15 Jun, 2015 03:42 PM

    Rhana's Avatar

    Hi Siskin,

    :) Gotta love automatic formatting!

    I'll ask our developers if they know of a way around this. Stay tuned!

    Rhana
    AdBlock Community Manager

  9. 7 Posted by Siskin on 15 Jun, 2015 03:55 PM

    Siskin's Avatar

    I got around that problem by patching (very dirty but works for testing purposes) adblock/filtering/filternormalizer.js:

    verifyDomains: function(domainSet) {
        for (var domain in domainSet.has) {
          if (domain === DomainSet.ALL)
            continue;     
            if (/^([a-z0-9\-_ß-öø-￿FF]+\.)*[a-z0-9ß-öø-￿FF]+\.?$/i.test(domain) == false)
              throw new Error("Invalid domain: " + domain);
            // Ensure domain doesn't break AdBlock
            FilterNormalizer._checkForObjectProperty(domain);
        }
    

    into

    verifyDomains: function(domainSet) {
        for (var domain in domainSet.has) {
          if (domain === DomainSet.ALL)
            continue;     
          if (domain != "chrome://apps")
          {
            if (/^([a-z0-9\-_ß-öø-￿FF]+\.)*[a-z0-9ß-öø-￿FF]+\.?$/i.test(domain) == false)
              throw new Error("Invalid domain: " + domain);
            // Ensure domain doesn't break AdBlock
            FilterNormalizer._checkForObjectProperty(domain);
          }
        }
    

    The rule is now loaded.

    I also loaded a listener in background.js that matches chrome://apps
    but the actual blocking code doesn't run when the tab is loaded.

    Baby steps...

    P.S. edit functionality for this page would be nice...

  10. Support Staff 8 Posted by Rhana on 15 Jun, 2015 04:04 PM

    Rhana's Avatar

    Hi Siskin,

    Thanks for the update! I'll let our developers know.

    Rhana
    AdBlock Community Manager

  11. 9 Posted by Siskin on 15 Jun, 2015 04:55 PM

    Siskin's Avatar

    In my continued quest to track down the code I need, i stumpled on something else...

    adblock_start_chrome.js is using

    chrome.extension.onRequest.addListener(elementPurger.onPurgeRequest);
    

    However, according to developer.chrome

    Deprecated since Chrome 33. Please use runtime.onMessage.
    

    Now back on topic.
    I can't get debug logging to work which is making everything 100 times harder.
    I assume that after enabling "Show debug statements in Console Log (which slows down AdBlock)" I should see debug messages in the F12 console but there are no logs there.
    Em I missing something ?

  12. Support Staff 10 Posted by Brent on 15 Jun, 2015 05:20 PM

    Brent's Avatar

    Hi Siskin,

    Thanks, we already know about the deprecated Chrome APIs.

    Regarding the log messages, most log messages can be seen on the console of the AdBlock background page.

    To get to the AdBlock background page, go to `chrome://extensions/'.

    Enable `Developer mode' by checking the check box in the upper right corner of the page.

    Then, under the AdBlock extension, click the link next to the Inspect views: background page. You should see the messages on the console tab of the background page.

    -- Brent

  13. 11 Posted by Siskin on 15 Jun, 2015 07:56 PM

    Siskin's Avatar

    Thanks, console confirmed my impression.
    chrome.extension.onRequest does not trigger on chrome internal links, only on external urls.

    The only solution i could find is make a tabs.onCreate listenener in background.js which calls a tabs.sendMessage(tab.id .... ) function.
    Then go to adblock_start_chrome.js, create a runtime.onMessage listener which calls the onPurgeRequest function.

    Theory seems good but it's beyond my current skill.
    I'm afraid I reached the limit of what I can do.

  14. Support Staff 12 Posted by Rhana on 19 Jun, 2015 10:08 PM

    Rhana's Avatar

    Hi Siskin,

    this sounds like a great idea for a future enhancement. Thanks for your suggestion! I've passed it on to our developers.

    If you have any experience in making browser extensions in HTML, CSS, JavaScript, and jQuery, please take a look at code.getadblock.com and send us a patch as an attachment! Our code is licensed under the GNU GPLv3.

    Rhana
    AdBlock Community Manager

  15. Rhana closed this discussion on 19 Jun, 2015 10:08 PM.

Discussions are closed to public comments.
If you need help with AdBlock please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac