diff --git a/CHANGELOG.md b/CHANGELOG.md index 44897d4..ca320ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,26 +1,26 @@ ## 0.0.6 -- update LICENSE to GNU GPL v3 764822f2e264754697c3729972ff93549afd4979 -- add specific website optimisation 764822f2e264754697c3729972ff93549afd4979 +- update LICENSE to GNU GPL v3 https://github.com/lowwebtech/low-web-extension/commit/764822f2e264754697c3729972ff93549afd4979 +- add specific website optimisation https://github.com/lowwebtech/low-web-extension/commit/764822f2e264754697c3729972ff93549afd4979 + hide useless content : add css rules based on url and when possible blocks requests + redirect known assets like images that would be available in a smaller size - youtube : + hide useless content : images on homepage and just to the right of the video + redirect assets : the image mqdefault.jpg is used for all preview instead of hqdefault.jpg, sddefault.jpg... + blocked assets : images on homepage and video page, animated images displayed when hovering a preview is blocked, video autoplayed on channel page is blocked -- sound : custom attributes autoplay=false, preload=none, loop=false acbaebe50f2c3eec1da447822ca3d437ca73044e +- sound : custom attributes autoplay=false, preload=none, loop=false https://github.com/lowwebtech/low-web-extension/commit/acbaebe50f2c3eec1da447822ca3d437ca73044e - video : - + sanitize Twitch embed url -> add autoplay=false 441dce70c281b2f8bf3d12a96b53a0ed736db2cf + + sanitize Twitch embed url -> add autoplay=false https://github.com/lowwebtech/low-web-extension/commit/441dce70c281b2f8bf3d12a96b53a0ed736db2cf + open Dailymotion embed inside iframe -- giphy : add support for webp images e015b9de5903543ea0bee557090c4ca0ef51a271 +- giphy : add support for webp images https://github.com/lowwebtech/low-web-extension/commit/e015b9de5903543ea0bee557090c4ca0ef51a271 - docs + Readme : added a Details section to explain precisely the functionality of the extensions + Options : new `website_specific` options (0: nothing, 1: data optimisation, 2: data and display optimisation) - + split test page image.html fa6ac787430994d49136b3b7bf966a2c1ee367c4 + + split test page image.html https://github.com/lowwebtech/low-web-extension/commit/fa6ac787430994d49136b3b7bf966a2c1ee367c4 - enhancements : better webRequest filters, remove unused listener, -- fix : quality options 64b0568add10b1cc6c3bf13a3985cc1369089839 -- fix : history state update 09a72ad13291b4d7e2929c4f2dc145cdab297784 -- fix : oEmbed return error e018d5afc3a5308693369232bfda689cc5ad96ec -- fix : instagram embed e015b9de5903543ea0bee557090c4ca0ef51a271 +- fix : quality options https://github.com/lowwebtech/low-web-extension/commit/64b0568add10b1cc6c3bf13a3985cc1369089839 +- fix : history state update https://github.com/lowwebtech/low-web-extension/commit/09a72ad13291b4d7e2929c4f2dc145cdab297784 +- fix : oEmbed return error https://github.com/lowwebtech/low-web-extension/commit/e018d5afc3a5308693369232bfda689cc5ad96ec +- fix : instagram embed https://github.com/lowwebtech/low-web-extension/commit/e015b9de5903543ea0bee557090c4ca0ef51a271 ## 0.0.5 - custom video embed on demand. Previously, video embed customisation was done one time after page loading (event 'load'). Now, a embed request blocked by background script triggers customisation in content_script diff --git a/Readme.md b/Readme.md index 8a15f7b..a443dd9 100644 --- a/Readme.md +++ b/Readme.md @@ -4,19 +4,16 @@ Reduce energy consumption and carbon footprint of your internet browsing. - Chromium : [https://chrome.google.com/webstore/detail/low-web-extension/jllfpicflcigpegdmejghjhaehdiabfj](https://chrome.google.com/webstore/detail/low-web-extension/jllfpicflcigpegdmejghjhaehdiabfj) - Firefox : [https://addons.mozilla.org/fr/firefox/addon/low-web-extension/](https://addons.mozilla.org/fr/firefox/addon/low-web-extension/) - - -:green_heart::herb::deciduous_tree::evergreen_tree::earth_africa: -## Why ? +## Why ? :green_heart::herb::deciduous_tree::evergreen_tree::earth_africa: The Internet consumes about 8% of the electricity produced worldwide and emits 3 to 4% of total greenhouse gas emissions. Every request, every resource, every calculation, is small amounts of electricity consumed ... and we visit billions of pages, make billions of computer operations, load billions of terabytes... needing to run millions of servers, millions of antennas, millions of miles of fiber and especially devices like telephones always more powerful and ever more obsolete. This extension aims to reduce our data and limit the energy consumption of our Internet browsing. -This extension affects electricity consumption when browsing the Internet but not during manufacturing. Manufacturing is the most energy consuming and polluting stage. So let's keep our phones and computers as long as possible ! +**This extension affects electricity consumption when browsing the Internet but not during manufacturing. Manufacturing is the most energy consuming and polluting stage. So let's keep our phones and computers as long as possible !** @@ -25,12 +22,13 @@ This extension affects electricity consumption when browsing the Internet but no A browser extension allows you to block resources and modify the content of a page. So we can optimize some content, block what is not necessary and thus limit the number of requests, weight and computer operations. -First, you need a good blocker for ad/malware/tracker like uBlock Origin ([Chrome](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm), [Firefox](https://addons.mozilla.org/fr/firefox/addon/ublock-origin/)) or a browser like [Brave](https://brave.com/). +First, you need a good blocker for ad/malware/tracker like [uBlock Origin](https://github.com/gorhill/uBlock), [Ghostery](https://www.ghostery.com/)... or a browser like [Firefox](https://www.mozilla.org/firefox/) or [Brave](https://brave.com/). +Reducing advertising and tracking is surely what will save you the most data. We made the choice in the extension not to deal with advertising, many extensions do it very well. ### Video -More than 80% of the data transferred over the Internet are videos. This extension tries to limit their use and the quality of the videos: +More than **80% of the data transferred over the Internet are videos**. This extension tries to limit their use and the quality of the videos: - when possible, the extension chooses a low video quality. For example on Youtube.com, the video will be played in 240p, 360p or 480p (Youtube, Vimeo, Dailymotion) - embed video iframes are blocked and a light preview is displayed. The click on a preview opens the video on the original site or in the iframe. We use oEmbed to get informations about the videos (Youtube, Vimeo, Dailymotion, Facebook). @@ -216,6 +214,9 @@ You can test this functionality on this page: [avatar.html](https://lowwebtech.g Feel free to PR or send me an email (vico @@@ lowweb.tech) to add more avatar urls into [avatar.txt](https://github.com/lowwebtech/low-web-extension/blob/master/src/lists/avatar.txt) +### Disable CSS animation & transition + + ## Development - load repository @@ -231,6 +232,8 @@ https://lowwebtech.github.io/low-web-extension/ ## TODO - listen dom change +- onboard, upboard and offboard +- display advice/tips/notificatio to settings for well-known websites - split into modules content_script, append at different time start/end/idle... - videos + look at https://stackoverflow.com/questions/31697212/youtube-api-cannot-change-video-quality @@ -240,6 +243,7 @@ https://lowwebtech.github.io/low-web-extension/ - add more oembed services https://oembed.com/ - look at webrequest type to maybe block them : beacon, csp_report, ping, speculative, web_manifest, websocket, xbl, xml_dtd, xslt - message between background blocker and content_script for temporary white-list +- context menu : 'Unblock content'... - write tests - lazyload optimized assets (gif/iframe) - block chatbot @@ -262,7 +266,6 @@ https://lowwebtech.github.io/low-web-extension/ - smaller injected script and styles - inject script and styles only when needed - audit the extension to limit size and processes (init, reflow...) -- display advice/tips to reduce bandwidth for main websites - display time alerts - try to block popin when mouse leaves the viewport @@ -298,4 +301,9 @@ https://lowwebtech.github.io/low-web-extension/ - slideshare - soundcloud - medium -- and more https://oembed.com/#section7 \ No newline at end of file +- and more https://oembed.com/#section7 + + +## Licence + +Code released under the [GNU GPLv3 License](LICENSE). diff --git a/package.json b/package.json index 8cc9ff1..b291521 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "low.", + "name": "low—web", "version": "0.0.6", "description": "Reduce energy consumption and carbon footprint of your internet browsing.", "author": "vico@lowweb.tech", diff --git a/src/icons/icon_128.png b/src/icons/icon_128.png index ed22453..d3ed0df 100644 Binary files a/src/icons/icon_128.png and b/src/icons/icon_128.png differ diff --git a/src/icons/icon_32.png b/src/icons/icon_32.png index e84955a..9557931 100644 Binary files a/src/icons/icon_32.png and b/src/icons/icon_32.png differ diff --git a/src/icons/icon_48.png b/src/icons/icon_48.png index 365049c..f0bbeff 100644 Binary files a/src/icons/icon_48.png and b/src/icons/icon_48.png differ diff --git a/src/icons/icon_96.png b/src/icons/icon_96.png index d5f5875..0b920de 100644 Binary files a/src/icons/icon_96.png and b/src/icons/icon_96.png differ diff --git a/src/manifest.json b/src/manifest.json index a187e69..6615403 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,8 +1,8 @@ { - "name": "low-web-extension", + "name": "low—web", "description": "Reduce energy consumption and carbon footprint of your internet browsing.", "version": null, - "short_name": "low.", + "short_name": "low—web", "manifest_version": 2, "icons": { "48": "icons/icon_48.png", @@ -20,7 +20,7 @@ "browser_action": { "browser_style": true, "default_icon": "icons/icon_32.png", - "default_title": "low-web-extension", + "default_title": "low—web", "default_popup": "popup/popup.html" }, "background": { @@ -51,6 +51,7 @@ "lists/*" ], "options_ui": { - "page": "options/options.html" + "page": "options/options.html", + "open_in_tab": true } } diff --git a/src/options/options.html b/src/options/options.html index 03de7ca..1926ede 100644 --- a/src/options/options.html +++ b/src/options/options.html @@ -2,7 +2,7 @@ - low-web-extension - Options + low—web - Options <% if (NODE_ENV === 'development') { %> diff --git a/src/scripts/content_script/image/players/GiphyPlayer.js b/src/scripts/content_script/image/players/GiphyPlayer.js index 3d2a7e9..4f90a2a 100644 --- a/src/scripts/content_script/image/players/GiphyPlayer.js +++ b/src/scripts/content_script/image/players/GiphyPlayer.js @@ -1,5 +1,5 @@ import { TOKEN } from '../../../datas/constants'; -import { getIdFromEmbed, getIdFromImage } from '../../../utils/giphy'; +import { getIdFromGiphyEmbed, getIdFromGiphyUrl } from '../../../utils/giphy'; import GifPlayer from './GifPlayer'; export default class GiphyPlayer extends GifPlayer { @@ -20,13 +20,11 @@ export default class GiphyPlayer extends GifPlayer { } else if (el.tagName === 'IMG') { // or img this.image = el; - this.id = getIdFromImage(src); + this.id = getIdFromGiphyUrl(src); } this.type = el.tagName.toLowerCase(); } setData(data) { - // TODO find best size / mp4 / webp - // fixed_height_still / fixed_width_still const previewUrl = data.images.downsized_still.url + '&lowweb=' + TOKEN; this.originalSrc = data.images.downsized.url + '&lowweb=' + TOKEN; diff --git a/src/scripts/utils/get-video-id.js b/src/scripts/utils/get-video-id.js index ac12d74..958ca7c 100644 --- a/src/scripts/utils/get-video-id.js +++ b/src/scripts/utils/get-video-id.js @@ -43,10 +43,3 @@ export function getFacebookId(url) { return null; } } -// export default { -// getYoutubeId, -// getVimeoId, -// getDailymotionId, -// getFacebookId, -// getTwitchId -// } diff --git a/src/scripts/utils/giphy.js b/src/scripts/utils/giphy.js index c5295ff..9684a82 100644 --- a/src/scripts/utils/giphy.js +++ b/src/scripts/utils/giphy.js @@ -1,4 +1,4 @@ -export function getIdFromEmbed(url) { +export function getIdFromGiphyEmbed(url) { url = url.split('giphy.com/embed/'); if (url.length > 1) { return url[1]; @@ -6,8 +6,7 @@ export function getIdFromEmbed(url) { return false; } } -export function getIdFromImage(url) { - // TODO regex +export function getIdFromGiphyUrl(url) { url = url.split('.giphy.com/media/'); if (url.length > 1) { if (url[1].indexOf('/giphy.gif') !== -1) { diff --git a/src/scripts/utils/is-webpage.js b/src/scripts/utils/is-webpage.js index 0bdde8e..f3440ae 100644 --- a/src/scripts/utils/is-webpage.js +++ b/src/scripts/utils/is-webpage.js @@ -1,7 +1,3 @@ -// TODO -// ^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$ export default function isWebpageUrl(url) { - // var re = new RegExp("^(http|https)://", "i"); - // return re.test(url); return url && url.startsWith('http'); }