Giter Club home page Giter Club logo

adlipo's Introduction

AdLiPo

Ongoing development for a uBlock-based variant of AdLiPo (v2)


Instructions

Building

  • clone the repo to your machine with git clone https://github.com/dhowe/AdLiPo.git
  • clone uAssets into the same parent folder with git clone https://github.com/uBlockOrigin/uAssets.git
  • then enter the AdLiPo folder (cd AdLiPo)
For Firefox (instructions checked on v95.0):
  1. run tools/make-firefox.sh (or sh tools/make-firefox.sh -all)
  2. then, in Firefox open about:debugging from the location bar
  3. click 'This Firefox' on the top-left, then click 'Load Temporary Add-on...'
  4. in the dialog that appears, navigate to dist/build/AdLiPo.firefox/ and select the manifest.json file
  5. AdLiPo should now be loaded in Firefox (check for the icon in the toolbar)
For Chromium (instructions checked on Chrome v96.0):
  1. run tools/make-chromium.sh (or sh tools/make-chromium.sh)
  2. then, in the browser open chrome://extensions from the location bar
  3. click 'Load unpacked' on the top-left
  4. in the dialog that appears, navigate to dist/build/ and select the AdLiPo.chromium folder
  5. AdLiPo should now be loaded in the browser (check for the icon in the toolbar)

Testing

After loading the extension:

  1. Visit test/test.html and make sure all divs on the page are hidden, then disable the extension and re-enable it, then make sure each rectangle is the same size as the original div.
  2. Visit https://rednoise.org/adntest/simple.html and do the same check.
  3. Visit https://hk.yahoo.com and verify that all ads are either hidden or replaced with rectangles. Disable the extension and enable it again, then make sure that more at least 75% of the ads are replaced. Pay attention to ads inserted in the news lists (when testing this from Asia, make sure the filter list AdGuard Chinese is enabled).

adlipo's People

Contributors

dhowe avatar real-john-cheung avatar stevenzhou01 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

adlipo's Issues

Limit ad width to the width of content

No sure how possible this is, but very necessary.
If not, perhaps we just skip ads greater than half the page width

again, the goal here is to be subtle, not to disrupt the page flow or design

image

Examples of bad text-generation

  • Foam flecked the lips of this Ad does is add words from the metaphor of page and portal.
  • This Ad that you have grown too old to blush.
  • This Ad deals with the advent of electricity, was turned upside down.
  • Lets allow the Ad swoon with delight.

[Question] New icons?

Should we create some new icons for

  • disable/enable ad replacement button on pop-up page (in UBO it is the button for toggle hiding element so it is an eye)
    the middle one
    圖片

  • toggle pop-up page button on logger page
    the right one
    圖片

Ad rectangles with multiple colors

What seems to be happening here is that the ad initially loads, then later reloads, but only the inner text is reloaded

example: nytimes.com

image

image

Tests before 1st release

@dhowe I think now we are ready for the before release test. I have tested in a few websites on firefox and chrome (mainly on a win64 machine). Could you create a list here for what tests should be done? and maybe @MelodyneedsMoney can also help with this.

Collect large images for specified resolutions

Collect large climate images for the specified resolution ratios: 4:3, 3:4, 32:9, 9:32, 2:1, 1:2

Target min sizes:
4:3 -> 960x720
2:1 -> 1000x500
32:9 -> 1920x540

Name them with the credit for the photographer and the dimensions: e.g., 'ChristopherFurlong_GettyImages_960x720.png'

Then place them in the correct folder for the ratio:

image

Climate Mockups

The goal is to create 3-5 examples of AdLiPo [climate] on actual webpages. I've included some examples from basic AdLipo below. The best ones are when there is some relationship between the page content and the ad. This is just for a slideshow, so fine to use photoshop or similar to mockup, ideally with the new formatting (as in the first image below). Each example should show 1 or 2 adlipo ads, not more.

Use the text below with any of the collected images in climate/images -- you may need to crop the images as most are not the correct resolution (perhaps @StevenZhou01 can help with this)

TEXT:
"Did you know that Advertising adds 28% to each person’s Carbon Footprint in the UK" 
"A child working in a mine in the Congo would need more than 700,000 years of non-stop work to earn the same amount as a single day of Bezos’ income." [perhaps on an amazon page] 
"Advertising is adding an extra 28% to the annual carbon footprint of every single person in the UK" [perhaps a Google ads, or doubleclick or facebook page ]
"In 2019 the UK advertising industry was responsible for more than 186 million tonnes of CO2" 
"In 2019 the UK advertising industry alone emitted CO2 equivalent to 47 coal-fired power plants running for 1 year."

[Climate] Identify set of common ad aspect-ratios

To replace our colored rectangles with random images from our image-set, we need a way to match the aspect ratio, then scale the image to the appropriate size for the ad rectangle on the page.

If we can identify a standard set of ad image ratios, then we can pre-select images for the image-set to match them...

Left padding too small

-- need more padding (perhaps double?) on left edge
-- should be based on either font-size or rectangle size, not a fixed number of pixels

image

Climate code in 'main' branch

Take a look at [injectTemplate.js ][https://github.com/dhowe/AdLiPo/blob/main/src/js/injectTemplate.js]. Looks like climate code in the main branch. Can we repair so that these are separate?

Ad layout not ideal

This should be a bigger font -- pls check that top/bottom padding is not too large and causing this problem:

image

Next steps (Climate)

  • design mockup
  • image selection / commits

Next

  • text generation
  • title / abstract

Too many ads on pages

  • [] define maximum ad size (if bigger, just hide)
  • [] define maximum number of visible ads (something like 2-3) [25]
  • [] create visible ads whitelist [28]

Want to avoid situations like below where the entire page is ads (or an ad dominates the page–should be more subtle):

https://www.businessinsider.com/how-to-make-a-playlist-on-alexa

image

Cross platform

When there is a change made (bug fix, new feature add ...), it is important to check it on different platforms (because we haven't used poly-fill -- as UBO did not do that) we should at least make sure it works on the below platforms:
Mac

  • Firefox
  • Chrome

Window

  • Firefox
  • Chrome

Modify UBO UI to hide irrelevant options

Change UBO UI

  • Icons

螢幕截圖 2021-07-14 下午1 29 12

  • pop-up page (the little page that shows up when the user click on the icon in the menu bar)

螢幕截圖 2021-07-14 下午1 30 20

  • setting page

螢幕截圖 2021-07-14 下午1 31 16

  • icon and text in the right-click menu

螢幕截圖 2021-07-14 下午1 31 49

  • change description and locales

Create dynamicLayout() function

Given a width, height, and padding for a div, and a text-string, should first compute the largest font-size that will fit the text (computeFontSize function), then assign the proper CSS (doLayout function).

  • should correctly computes the correct font size
  • correctly handles different padding values (a single value for 4 edges)
  • avoid 'orphans' (use   for last space)

Assumptions

  • Can assume Bench9 (via ttf or google font)
  • Can assume left horizontal alignment
  • Can assume center vertical alignment
  • Can use whatever word-break is easiest

Format quotation file as json

file: https://github.com/dhowe/AdLiPo/blob/climate/climate/quotations.json ('climate' branch)

  • format as json following example at top
  • add quotations in the next comment below
  • check it with a linter (eg https://jsonlint.com/)
  • remove blank lines between array entries in json
  • #50
  • find more similar quotations to add to file
  • include the year in the file name if it is available

For the last checkbox, ideally the quotations are more factual, along the lines of the following:

{
  "quote": "A child working in a mine in the Congo would need more than 700,000 years of non-stop work to earn the same amount as a single day of Bezos’ income.",
  "author": "Kate Crawford and Vladan Joler",
  "author-meta": "",
  "source": "Anatomy of an AI System",
  "date": "2018"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.