Skip to content

Commit

Permalink
rename low—web, update readme, fix changelog and clean
Browse files Browse the repository at this point in the history
  • Loading branch information
vico - low web committed Feb 11, 2020
1 parent 0e075ca commit f77c96f
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 43 deletions.
20 changes: 10 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 17 additions & 9 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 !**



Expand All @@ -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).
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -298,4 +301,9 @@ https://lowwebtech.github.io/low-web-extension/
- slideshare
- soundcloud
- medium
- and more https://oembed.com/#section7
- and more https://oembed.com/#section7


## Licence

Code released under the [GNU GPLv3 License](LICENSE).
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Binary file modified src/icons/icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icons/icon_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icons/icon_48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icons/icon_96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "low-web-extension",
"name": "lowweb",
"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",
Expand All @@ -20,7 +20,7 @@
"browser_action": {
"browser_style": true,
"default_icon": "icons/icon_32.png",
"default_title": "low-web-extension",
"default_title": "lowweb",
"default_popup": "popup/popup.html"
},
"background": {
Expand Down Expand Up @@ -51,6 +51,7 @@
"lists/*"
],
"options_ui": {
"page": "options/options.html"
"page": "options/options.html",
"open_in_tab": true
}
}
2 changes: 1 addition & 1 deletion src/options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>low-web-extension - Options</title>
<title>lowweb - Options</title>
<link rel="stylesheet" href="options.css">
<% if (NODE_ENV === 'development') { %>
<!-- Load some resources only in development environment -->
Expand Down
6 changes: 2 additions & 4 deletions src/scripts/content_script/image/players/GiphyPlayer.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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;

Expand Down
7 changes: 0 additions & 7 deletions src/scripts/utils/get-video-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,3 @@ export function getFacebookId(url) {
return null;
}
}
// export default {
// getYoutubeId,
// getVimeoId,
// getDailymotionId,
// getFacebookId,
// getTwitchId
// }
5 changes: 2 additions & 3 deletions src/scripts/utils/giphy.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
export function getIdFromEmbed(url) {
export function getIdFromGiphyEmbed(url) {
url = url.split('giphy.com/embed/');
if (url.length > 1) {
return url[1];
} else {
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) {
Expand Down
4 changes: 0 additions & 4 deletions src/scripts/utils/is-webpage.js
Original file line number Diff line number Diff line change
@@ -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');
}

0 comments on commit f77c96f

Please sign in to comment.