Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Commit

Permalink
Release Behind The Overlay Revival v1.8.0
Browse files Browse the repository at this point in the history
LICENSE:

- Updated LICENSE file.

README:

- Updated README and 'BOR' images.

WebExtension:

- Updated WebExtension functionality.
- Recovered oldest project logo (Sorry!).
- Replaced PNG with SVG icons.
- Replaced 'browserAction' with 'pageAction'.
- Removed context menu support (useless right now).
- Removed unnecessary files.

Translations:

- Updated translation files.
- Replaced useless messages strings.
- Added translation support to 'overlay_remover.js'.
  • Loading branch information
ivanruvalcaba committed Sep 4, 2017
1 parent 720f6d6 commit 999598f
Show file tree
Hide file tree
Showing 20 changed files with 155 additions and 194 deletions.
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2016 Icaro Perseo
Copyright (c) 2017, Iván Ruvalcaba <mario.i.ruvalcaba[at]gmail[dot]com>
Copyright (c) 2014, Namolovan Nicolae (https://twitter.com/NicolaeNMV)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
27 changes: 12 additions & 15 deletions README.markdown → README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[//]: # (Filename: README.md)
[//]: # (Author: Icaro Perseo)
[//]: # (Contact: <icaroperseo[at]protonmail[dot]com>)
[//]: # (Author: Iván Ruvalcaba)
[//]: # (Contact: <mario.i.ruvalcaba[at]gmail[dot]com>)
[//]: # (Created: 26 dic 2016 16:50:04)
[//]: # (Last Modified: 27 dic 2016 11:49:52)
[//]: # (Last Modified: 03 sep 2017 18:52:30)

# Behind The Overlay Revival —Mozilla Firefox and Google Chrome Web Extension
# Behind The Overlay Revival —Mozilla Firefox WebExtension

> This project is a fork of [Behind The Overlay](https://github.com/NicolaeNMV/BehindTheOverlay) add-on, ported as web extension for _Mozilla Firefox_ as well as some improvements implemented for both web browsers.
> This project is a fork of [Behind The Overlay](https://github.com/NicolaeNMV/BehindTheOverlay) add-on, ported as _Mozilla Firefox WebExtension_ as well as some improvements implemented.
## What's it all about?

Expand All @@ -16,9 +16,9 @@ I find this very annoying as every site will have a different way to close that

This extension solves this problem by offering you **one button to close any overlay on any website** you may ever encounter.

## Web Extension in action
## WebExtension in action

<img src="resources/bor-demo.gif" alt="Behind The Overlay Revival in action" style="width: 800px;"/>
![](docs/bor.jpg "Remove overlay")

## Does it work everywhere ?

Expand All @@ -34,14 +34,11 @@ The extension should work on all sites that have overlays.

## Changelog

* [x] Porting the original complement as _Firefox Web Extension_.
* [x] Fix minor issues (typos).
* [x] Improve the original code (just a bit).
* [x] Add _Behind The Overlay Revival_ to context menu.
* [x] Add to _Behind The Overlay Revival_ one shortcut (`Alt + Shift + x`).
* [x] English/Spanish translations added (locale support).
* [ ] Add user menu to change the default shortcut.
* [ ] Add site whitelist/blacklist support (**on user demand**).
+ Porting the original complement as _Firefox Web Extension_.
+ Improved the original code.
+ Add to _Behind The Overlay Revival_ one shortcut (`Alt + Shift + x`).
+ English/Spanish translations added (locale support).
+ Implemented a clickable icon inside the browser's address bar (`pageAction`).

## Feedback

Expand Down
Binary file removed design/logo.png
Binary file not shown.
118 changes: 0 additions & 118 deletions design/logo.svg

This file was deleted.

Binary file added docs/bor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
12 changes: 6 additions & 6 deletions extension/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"message": "Click to close any overlay popup on any website.",
"description": "Description of the extension."
},
"defaultBrowserActionTitle": {
"message": "Remove the overlay from this page",
"defaultPageActionTitle": {
"message": "Remove the overlay from this page.",
"description": "Description of the browser action."
},
"suggestedKeyTitle": {
"message": "Remove the overlay from this page",
"message": "Remove the overlay from this page.",
"description": "Description of the suggested key."
},
"contextMenuRemoveOverlayTitle": {
"message": "Remove the overlay from this page",
"description": "Description of the context menu remove overlay."
"noOverlayAlertMessage": {
"message": "No overlay has been found on this website.",
"description": "Description of alert message."
}
}
12 changes: 6 additions & 6 deletions extension/_locales/es/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"message": "Cierre el mensaje emergente de algún sitio web con un solo clic.",
"description": "Description of the extension."
},
"defaultBrowserActionTitle": {
"message": "Cerrar el mensaje emergente de esta página",
"defaultPageActionTitle": {
"message": "Cerrar el mensaje emergente de esta página.",
"description": "Description of the browser action."
},
"suggestedKeyTitle": {
"message": "Cerrar el mensaje emergente de esta página",
"message": "Cerrar el mensaje emergente de esta página.",
"description": "Description of the suggested key."
},
"contextMenuRemoveOverlayTitle": {
"message": "Cerrar el mensaje emergente de esta página",
"description": "Description of the context menu remove overlay."
"noOverlayAlertMessage": {
"message": "No se encontró ningún mensaje emergente en esta página.",
"description": "Description of alert message."
}
}
75 changes: 75 additions & 0 deletions extension/img/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed extension/img/icon-16.png
Binary file not shown.
Binary file removed extension/img/icon-19.png
Binary file not shown.
Binary file removed extension/img/icon-38.png
Binary file not shown.
Binary file removed extension/img/icon.png
Binary file not shown.
Binary file removed extension/img/[email protected]
Binary file not shown.
10 changes: 5 additions & 5 deletions resources/logo-amo.svg → extension/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 26 additions & 15 deletions extension/js/background.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
// Get the translated string for context menu.
const contextMenuRemoveOverlayTitle = browser.i18n.getMessage(
'contextMenuRemoveOverlayTitle');
let expression = /(http(s?)):\/\//gi;
let regex = new RegExp(expression);
let gettingAllTabs = browser.tabs.query({});

// Returns true only if the URL's protocol is in APPLICABLE_PROTOCOLS.
function protocolIsApplicable(url) {
return url.match(regex);
}

// Initialize the page action. Only operates on tabs whose URL's protocol is applicable.
function initializePageAction(tab) {
if (protocolIsApplicable(tab.url)) {
browser.pageAction.show(tab.id);
}
}

// Main script.
function removeOverlay() {
// No tabs or host permissions needed!
browser.tabs.executeScript(null, {file: '/js/overlay_remover.js'},
Expand All @@ -11,18 +24,16 @@ function removeOverlay() {
});
}

// Create all the context menu items.
browser.contextMenus.create({
id: 'removeOverlay',
title: contextMenuRemoveOverlayTitle
// When first loaded, initialize the page action for all tabs.
gettingAllTabs.then((tabs) => {
for (let tab of tabs) {
initializePageAction(tab);
}
});

// The click event listener, where we perform the appropriate action given the
// ID of the menu item that was clicked.
browser.contextMenus.onClicked.addListener(function(info) {
if (info.menuItemId === 'removeOverlay') {
removeOverlay();
}
// Each time a tab is updated, reset the page action for that tab.
browser.tabs.onUpdated.addListener((id, changeInfo, tab) => {
initializePageAction(tab);
});

// Shortcut listener.
Expand All @@ -32,5 +43,5 @@ browser.commands.onCommand.addListener(function(command) {
}
});

// Called when the user clicks on the browser action.
browser.browserAction.onClicked.addListener(removeOverlay);
// Called when the user clicks on the page action.
browser.pageAction.onClicked.addListener(removeOverlay);
Loading

0 comments on commit 999598f

Please sign in to comment.