This repository has been archived by the owner on Aug 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
395 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web-ext-artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/* global browser */ | ||
const ABOUT_PAGES = [ | ||
["about:", "firefox", false], | ||
["about:about", "cog", false], | ||
["about:accounts", "user", false], | ||
["about:addons", "plugin", false], | ||
["about:blank", "page-white", true], | ||
["about:buildconfig", "building", false], | ||
["about:cache", "drive", false], | ||
["about:checkerboard", "chart-line", false], | ||
["about:config", "wrench", false], | ||
["about:crashes", "error", false], | ||
["about:credits", "vcard", false], | ||
["about:debugging", "script-lightning", false], | ||
["about:devtools-toolbox", "wrench-orange", false], | ||
["about:downloads", "drive-down", false], | ||
["about:healthreport", "heart", false], | ||
["about:home", "house", true], | ||
["about:license", "report", true], | ||
["about:logo", "picture-empty", true], | ||
["about:memory", "memory", false], | ||
["about:mozilla", "world", false], | ||
["about:networking", "world-network", false], | ||
["about:newtab", "tab", false], | ||
["about:performance", "server-lightning", false], | ||
["about:plugins", "plugin", false], | ||
["about:preferences", "options-wrench", false], | ||
["about:privatebrowsing", "lock", false], | ||
["about:profiles", "group", false], | ||
["about:rights", "receipt", true], | ||
["about:robots", "user-red", false], | ||
["about:serviceworkers", "script-gear", false], | ||
["about:sessionrestore", "lightning", false], | ||
["about:support", "help", false], | ||
["about:sync-log", "page-refresh", false], | ||
["about:sync-tabs", "tabs-refresh", false], | ||
["about:telemetry", "chart-curve", false], | ||
["about:webrtc", "phone", false], | ||
["about:welcomeback", "emoticon-smile", false] | ||
]; | ||
|
||
/** | ||
* @param {type} message | ||
* @param {type} resolve | ||
* @param {type} privileged | ||
* @returns {undefined} | ||
*/ | ||
function registerPage(message, resolve, privileged) { | ||
let data = []; | ||
data[0] = String(message.page); | ||
data[1] = String(message.icon !== undefined ? message.icon : ""); | ||
data[2] = !Boolean(message.privileged); | ||
|
||
let isNew = true; | ||
if (privileged) { | ||
for (let i = 0; i < ABOUT_PAGES.length; i++) { | ||
let d = ABOUT_PAGES[i]; | ||
if (data[0].localeCompare(d[0], {sensitivity: "accent", numeric: true}) === 0) { | ||
ABOUT_PAGES.slice(i, 1); | ||
} | ||
} | ||
} else { | ||
for (let d in ABOUT_PAGES) { | ||
if (data[0].localeCompare(d[0], {sensitivity: "accent", numeric: true}) === 0) { | ||
isNew = false; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
if (isNew) { | ||
ABOUT_PAGES.push(data); | ||
ABOUT_PAGES.sort((a, b) => { | ||
return a[0].localeCompare(b[0], { | ||
sensitivity: "accent", | ||
numeric: true | ||
}) | ||
}); | ||
} | ||
resolve(isNew); | ||
return; | ||
} | ||
|
||
browser.runtime.onMessage.addListener((message, sender, resolve) => { | ||
let messageType = String(message.type); | ||
switch (messageType) { | ||
case "registerPage": { | ||
registerPage(message, resolve, true); | ||
break; | ||
} case "getPages": { | ||
resolve({pages: ABOUT_PAGES.slice()}); | ||
return; | ||
} default: { | ||
throw new Error("Invalid message type: " + messageType); | ||
} | ||
} | ||
}); | ||
|
||
browser.runtime.onMessageExternal.addListener((message, sender, resolve) => { | ||
let messageType = String(message.type); | ||
switch (messageType) { | ||
case "registerPage": { | ||
registerPage(message, resolve, false); | ||
break; | ||
} default: { | ||
throw new Error("Invalid message type: " + messageType); | ||
} | ||
} | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" ?> | ||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> | ||
<!-- This file contains mata data about the icons --> | ||
<Description> | ||
<creator>Michael Buckley</creator> | ||
<id>[email protected]</id> | ||
<name>Pastel SVG Icons</name> | ||
<version>1.2</version> | ||
<description>An Icon set based on famfamfam.</description> | ||
<homepageURL>http://codefisher.org/pastel-svg/</homepageURL> | ||
</Description> | ||
</RDF> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The Pastel SVG icon set Created by Michael Buckley is licensed under the: | ||
|
||
Creative Commons Attribution NonCommercial Share Alike 4.0 | ||
http://creativecommons.org/licenses/by-nc-sa/4.0/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"applications": { | ||
"gecko": { | ||
"id": "about-button@exe-boss", | ||
"strict_min_version": "52.0" | ||
} | ||
}, | ||
|
||
"manifest_version": 2, | ||
"name": "Firefox about:about Button", | ||
"version": "0.1.0b1", | ||
"author": "ExE Boss", | ||
"description": "A Firefox exclusive WebExtension to quickly open about:* pages", | ||
|
||
"permissions": [ | ||
"storage" | ||
], | ||
"icons": { | ||
"16": "icons/16/cog.png", | ||
"24": "icons/24/cog.png", | ||
"32": "icons/32/cog.png", | ||
"48": "icons/48/cog.png", | ||
"64": "icons/64/cog.png", | ||
"72": "icons/72/cog.png", | ||
"96": "icons/96/cog.png", | ||
"128":"icons/128/cog.png", | ||
"256":"icons/256/cog.png" | ||
}, | ||
|
||
"background": { | ||
"scripts": ["background.js"] | ||
}, | ||
"browser_action": { | ||
"browser_style": true, | ||
"default_icon": { | ||
"16": "icons/16/cog.png", | ||
"24": "icons/24/cog.png", | ||
"32": "icons/32/cog.png", | ||
"48": "icons/48/cog.png", | ||
"64": "icons/64/cog.png", | ||
"72": "icons/72/cog.png", | ||
"96": "icons/96/cog.png", | ||
"128":"icons/128/cog.png", | ||
"256":"icons/256/cog.png" | ||
}, | ||
"default_title": "about:about", | ||
"default_popup": "popup/popup.html" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Firefox about:about Button Options</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<script src="options.js"></script> | ||
</head> | ||
<body> | ||
<div> | ||
<input id="showDisabledButtons" type="checkbox" checked>Show disabled buttons | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* global browser */ | ||
|
||
function restore_options() { | ||
browser.storage.local.get({ | ||
showDisabledButtons: true | ||
}).then((settings) => { | ||
document.getElementById("showDisabledButtons").checked = settings.showDisabledButtons; | ||
}).catch((error) => { | ||
document.getElementById("showDisabledButtons").checked = true; | ||
}); | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', () => {restore_options()}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
html, body { | ||
overflow-x: hidden !important; | ||
} | ||
|
||
body { | ||
margin: 4px !important; | ||
} | ||
|
||
button { | ||
width: 100% !important; | ||
text-align: left !important; | ||
white-space: nowrap; | ||
} | ||
|
||
button:disabled { | ||
background-color: #CCC !important; | ||
border: solid !important; | ||
border-width: 1px !important; | ||
border-color: #777 !important; | ||
} | ||
|
||
#main-table { | ||
width: 100% !important; | ||
margin-right: 16px !important; | ||
border-spacing: 8px !important; | ||
} | ||
|
||
a { | ||
text-decoration: none !important; | ||
color: black !important; | ||
} | ||
|
||
.icon { | ||
vertical-align: middle !important; | ||
margin-right: 8px !important; | ||
} | ||
|
||
.icon.missing { | ||
margin-right: 24px !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>about:about</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" type="text/css" href="popup.css"> | ||
<script src="popup.js"></script> | ||
</head> | ||
<body> | ||
<div id="header"></div> | ||
<main id="main"> | ||
<table id="main-table"></table> | ||
</main> | ||
<div id="footer"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* global browser */ | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
browser.storage.onChanged.addListener((changes, areaName) => { | ||
switch (areaName) { | ||
case "local": { | ||
if (changes.showDisabledButtons !== undefined) { | ||
reload(); | ||
} | ||
break; | ||
} | ||
} | ||
}); | ||
reload(); | ||
}); | ||
|
||
async function reload() { | ||
let footer = document.getElementById("footer"); | ||
let table = document.getElementById("main-table"); | ||
|
||
table.innerHTML = ""; | ||
footer.innerHTML = ""; | ||
|
||
browser.runtime.sendMessage({ | ||
type: "getPages" | ||
}).then(async (response) => { | ||
response.showDisabledButtons = await browser.storage.local.get({ | ||
showDisabledButtons: true | ||
}).then((settings) => { | ||
return settings.showDisabledButtons; | ||
}).catch((error) => { | ||
console.error(error); | ||
return true; | ||
}); | ||
return response; | ||
}).then(async (response) => { | ||
let pages = response.pages; | ||
let showDisabledButtons = response.showDisabledButtons; | ||
|
||
if (showDisabledButtons === undefined) | ||
showDisabledButtons = true; | ||
if (!showDisabledButtons) { | ||
footer.appendChild(document.createTextNode("Disabled buttons have been hidden")); | ||
} | ||
pages.forEach((page) => { | ||
let tr = document.createElement("tr"); | ||
let td = document.createElement("td"); | ||
|
||
let button = document.createElement("button"); | ||
let img = generateImg(page[1]); | ||
button.setAttribute("type", button); | ||
if (!page[2]) | ||
button.setAttribute("disabled", true); | ||
button.appendChild(img); | ||
button.appendChild(document.createTextNode(page[0])); | ||
button.addEventListener("click", (evt) => { | ||
if (page[2]) { | ||
browser.tabs.create({url: page[0]}); | ||
} else { | ||
browser.tabs.create({url: "/redirect/redirect.html?dest=" + page[0]}); | ||
} | ||
}); | ||
|
||
if (page[2] || (!page[2] && showDisabledButtons)) { | ||
td.appendChild(button); | ||
tr.appendChild(td); | ||
table.appendChild(tr); | ||
} | ||
}); | ||
}).catch(async (error) => { | ||
console.error(error); | ||
}); | ||
} | ||
|
||
/** | ||
* @param {String} path | ||
* @returns {HTMLImgElement} | ||
*/ | ||
function generateImg(path) { | ||
let img = document.createElement("img"); | ||
img.setAttribute("class", "icon"); | ||
img.setAttribute("width", "16px"); | ||
if (path && path.length !== 0) { | ||
// img.setAttribute("src", "/icons/SVG/" + path + ".svg"); | ||
img.setAttribute("src", "/icons/256/" + path + ".png"); | ||
} else { | ||
img.setAttribute("class", "icon missing"); | ||
} | ||
return img; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>about:about</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<script src="redirect.js"></script> | ||
</head> | ||
<body id="body"> | ||
</body> | ||
</html> |
Oops, something went wrong.