Commit e3281438 by Ruben Rodriguez

Abrowser: new about:home page and artwork

parent 8e3c7f41
Extension built by Ruben Rodriguez using pieces of torbutton as a template
Copyright (c) 2014, Ruben Rodriguez <ruben@gnu.org>
Copyright (c) 2013, The Tor Project, Inc.
Copyright (c) 2006 Scott Squires, Oleg Ivanov
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 the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
content abrowserhome chrome/content/
locale abrowserhome af chrome/locale/es/
locale abrowserhome ak chrome/locale/en/
component {a364a9c0-2960-11e4-8c21-0800200c9a66} components/aboutAbrowser.js
contract @mozilla.org/network/protocol/about;1?what=startpage {a364a9c0-2960-11e4-8c21-0800200c9a66}
contract @mozilla.org/network/protocol/about;1?what=home {a364a9c0-2960-11e4-8c21-0800200c9a66}
/*
Copyright (c) 2014, Ruben Rodriguez <ruben@gnu.org>
Copyright (c) 2013, The Tor Project, Inc.
Copyright (c) 2006 Scott Squires, Oleg Ivanov
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 the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
// Module specific constants
const kMODULE_NAME = "about:abrowser";
const kMODULE_CONTRACTID = "@mozilla.org/network/protocol/about;1?what=abrowser";
const kMODULE_CID = Components.ID("a364a9c0-2960-11e4-8c21-0800200c9a66");
const kAboutAbrowserURL = "chrome://abrowserhome/content/aboutAbrowser/aboutAbrowser.xhtml";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
function AboutAbrowser()
{
}
AboutAbrowser.prototype =
{
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
// nsIClassInfo implementation:
classDescription: kMODULE_NAME,
classID: kMODULE_CID,
contractID: kMODULE_CONTRACTID,
// nsIAboutModule implementation:
newChannel: function(aURI)
{
let ioSvc = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
let channel = ioSvc.newChannel(kAboutAbrowserURL, null, null);
channel.originalURI = aURI;
return channel;
},
getURIFlags: function(aURI)
{
return Ci.nsIAboutModule.ALLOW_SCRIPT;
}
};
const NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutAbrowser]);
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:name>AbrowserHome</em:name>
<em:creator>Ruben Rodriguez</em:creator>
<em:id>aboutabrowser@trisquel.info</em:id>
<em:version>1.1</em:version>
<em:updateURL>https://127.0.0.1/</em:updateURL>
<em:multiprocessCompatible>true</em:multiprocessCompatible>
<!-- <em:updateKey></em:updateKey> -->
<!-- firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>30.0</em:minVersion>
<em:maxVersion>10000.0</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
%if 0
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%endif
html {
font: message-box;
......@@ -40,8 +35,8 @@ a {
}
#brandLogo {
height: 420px;
width: 150px;
height: 150px;
width: 420px;
margin: 22px auto 31px;
background-image: url("chrome://branding/content/about-logo.png");
background-size: 420px 150px;
......@@ -49,90 +44,105 @@ a {
background-repeat: no-repeat;
}
#searchForm,
#searchIconAndTextContainer,
#snippets {
width: 470px;
}
#searchForm {
#searchIconAndTextContainer {
display: -moz-box;
height: 36px;
position: relative;
}
#searchLogoContainer {
display: -moz-box;
-moz-box-align: center;
padding-top: 2px;
-moz-padding-end: 8px;
}
#searchLogoContainer[hidden] {
display: none;
}
#searchEngineLogo {
display: inline-block;
height: 28px;
width: 70px;
min-width: 70px;
#searchIcon {
border: 1px transparent;
padding: 0;
margin: 0;
width: 36px;
height: 36px;
background: url("chrome://browser/skin/search-indicator-magnifying-glass.svg") center center no-repeat;
position: absolute;
}
#searchText {
margin-left: 0;
-moz-box-flex: 1;
padding: 6px 8px;
padding-top: 6px;
padding-bottom: 6px;
padding-inline-start: 34px;
padding-inline-end: 8px;
background: hsla(0,0%,100%,.9) padding-box;
border: 1px solid;
border-radius: 2px 0 0 2px;
border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2);
box-shadow: 0 1px 0 hsla(210,65%,9%,.02) inset,
0 0 2px hsla(210,65%,9%,.1) inset,
0 1px 0 hsla(0,0%,100%,.2);
border-radius: 2.5px 0 0 2.5px;
color: inherit;
unicode-bidi: plaintext;
}
#searchText:dir(rtl) {
border-radius: 0 2px 2px 0;
}
#searchText:-moz-dir(rtl) {
border-radius: 0 2.5px 2.5px 0;
#searchText[aria-expanded="true"] {
border-radius: 2px 0 0 0;
}
#searchText[aria-expanded="true"]:dir(rtl) {
border-radius: 0 2px 0 0;
}
#searchText[keepfocus],
#searchText:focus,
#searchText[autofocus] {
border-color: hsla(206,100%,60%,.6) hsla(206,76%,52%,.6) hsla(204,100%,40%,.6);
}
#searchSubmit {
-moz-margin-start: -1px;
background: linear-gradient(hsla(0,0%,100%,.8), hsla(0,0%,100%,.1)) padding-box;
padding: 0 9px;
margin-inline-start: -1px;
color: transparent;
background: url("chrome://browser/skin/search-arrow-go.svg") center center no-repeat, linear-gradient(hsla(0,0%,100%,.8), hsla(0,0%,100%,.1)) padding-box;
-moz-context-properties: fill;
fill: #616366;
padding: 0;
border: 1px solid;
border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2);
-moz-border-start: 1px solid transparent;
border-radius: 0 2.5px 2.5px 0;
border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2) transparent;
border-radius: 0 2px 2px 0;
box-shadow: 0 0 2px hsla(0,0%,100%,.5) inset,
0 1px 0 hsla(0,0%,100%,.2);
cursor: pointer;
transition-property: background-color, border-color, box-shadow;
transition-duration: 150ms;
width: 50px;
}
#searchSubmit:-moz-dir(rtl) {
border-radius: 2.5px 0 0 2.5px;
#searchSubmit:dir(rtl) {
transform: scaleX(-1);
}
#searchText:focus + #searchSubmit,
#searchText[keepfocus] + #searchSubmit,
#searchText + #searchSubmit:hover,
#searchText[autofocus] + #searchSubmit {
border-color: #59b5fc #45a3e7 #3294d5;
color: white;
}
#searchText:focus + #searchSubmit,
#searchText[keepfocus] + #searchSubmit,
#searchText[autofocus] + #searchSubmit {
background-image: linear-gradient(#4cb1ff, #1793e5);
background-image: url("chrome://browser/skin/search-arrow-go.svg"), linear-gradient(#4cb1ff, #1793e5);
fill: white;
box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset,
0 0 0 1px hsla(0,0%,100%,.1) inset,
0 1px 0 hsla(210,54%,20%,.03);
}
#searchText + #searchSubmit:hover {
background-image: linear-gradient(#66bdff, #0d9eff);
background-image: url("chrome://browser/skin/search-arrow-go.svg"), linear-gradient(#66bdff, #0d9eff);
fill: white;
box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset,
0 0 0 1px hsla(0,0%,100%,.1) inset,
0 1px 0 hsla(210,54%,20%,.03),
......@@ -150,19 +160,19 @@ a {
#rightsSnippet {
display: block;
min-height: 38px;
background: 30px center no-repeat;
background: 0 center no-repeat;
padding: 6px 0;
-moz-padding-start: 79px;
padding-inline-start: 49px;
}
#rightsSnippet[hidden] {
display: none;
}
#defaultSnippet1:-moz-dir(rtl),
#defaultSnippet2:-moz-dir(rtl),
#rightsSnippet:-moz-dir(rtl) {
background-position: right 30px center;
#defaultSnippet1:dir(rtl),
#defaultSnippet2:dir(rtl),
#rightsSnippet:dir(rtl) {
background-position: right 0 center;
}
#defaultSnippet1 {
......@@ -217,7 +227,7 @@ body[narrow] #launcher[session] {
white-space: normal;
background: transparent padding-box;
border: 1px solid transparent;
border-radius: 2.5px;
border-radius: 2px;
color: #525c66;
font-size: 75%;
cursor: pointer;
......@@ -299,10 +309,6 @@ body[narrow] #restorePreviousSession {
content: url("chrome://browser/content/abouthome/history.png");
}
#apps::before {
content: url("chrome://browser/content/abouthome/apps.png");
}
#addons::before {
content: url("chrome://browser/content/abouthome/addons.png");
}
......@@ -322,10 +328,10 @@ body[narrow] #restorePreviousSession {
display: inline-block; /* display on same line as text label */
vertical-align: middle;
margin-bottom: 0;
-moz-margin-end: 8px;
margin-inline-end: 8px;
}
#restorePreviousSession:-moz-dir(rtl)::before {
#restorePreviousSession:dir(rtl)::before {
transform: scaleX(-1);
}
......@@ -339,21 +345,21 @@ body[narrow] #restorePreviousSession::before {
display: block;
position: relative; /* pin wordmark to edge of document, not of viewport */
-moz-box-ordinal-group: 0;
opacity: .5;
opacity: .2;
transition: opacity 150ms;
}
#aboutMozilla:hover {
opacity: 1;
opacity: .6;
}
#aboutMozilla::before {
content: url("chrome://browser/content/abouthome/mozilla.png");
content: url("chrome://browser/content/abouthome/mozilla.svg");
display: block;
position: absolute;
top: 12px;
right: 12px;
width: 69px;
offset-inline-end: 12px;
width: 67px;
height: 19px;
}
......@@ -362,9 +368,6 @@ body[narrow] #restorePreviousSession::before {
* rather than upscaling the original-size ones (bug 818940).
*/
@media not all and (max-resolution: 1dppx) {
#brandLogo {
background-image: url("chrome://branding/content/about-logo@2x.png");
}
#defaultSnippet1,
#defaultSnippet2,
......@@ -380,12 +383,15 @@ body[narrow] #restorePreviousSession::before {
background-image: url("chrome://browser/content/abouthome/snippet2@2x.png");
}
.launchButton::before,
#aboutMozilla::before {
.launchButton::before {
transform: scale(.5);
transform-origin: 0 0;
}
.launchButton:dir(rtl)::before {
transform: scale(.5) translateX(32px);
}
#downloads::before {
content: url("chrome://browser/content/abouthome/downloads@2x.png");
}
......@@ -398,10 +404,6 @@ body[narrow] #restorePreviousSession::before {
content: url("chrome://browser/content/abouthome/history@2x.png");
}
#apps::before {
content: url("chrome://browser/content/abouthome/apps@2x.png");
}
#addons::before {
content: url("chrome://browser/content/abouthome/addons@2x.png");
}
......@@ -422,8 +424,8 @@ body[narrow] #restorePreviousSession::before {
content: url("chrome://browser/content/abouthome/restore@2x.png");
}
#aboutMozilla::before {
content: url("chrome://browser/content/abouthome/mozilla@2x.png");
#restorePreviousSession:dir(rtl)::before {
transform: scale(-0.5, 0.5) translateX(24px);
transform-origin: top center;
}
}
......@@ -24,126 +24,41 @@
<link rel="icon" type="image/png" id="favicon"
href="chrome://branding/content/icon32.png"/>
<link rel="stylesheet" type="text/css" media="all"
href="chrome://browser/content/contentSearchUI.css"/>
<link rel="stylesheet" type="text/css" media="all" defer="defer"
href="chrome://browser/content/abouthome/aboutHome.css"/>
<style>
body{
margin:0;
background-color:#f2f2f2;
}
#box{
display: flex;
flex-flow: column;
justify-content: space-between;
align-items: center;
align-content: center;
height: 100vh;
}
#topSection, #box3, #block-horizontal-margin{
flex: 0 1 auto;
align-self: auto;
}
#topSection {
margin-top:10vh;
order:1;
}
#block-horizontal-margin{
order:2;
}
#box3{
order:3;
width:100vw;
}
label{
position:relative;
bottom:2px;
left:2px;
}
em {
color:#600
}
a{
color:#004998
}
.block-side-margin {
min-width: 16px;
-moz-box-flex: 1;
}
#block-horizontal-margin {
display: -moz-box;
-moz-box-flex: 1;
}
ul li {
list-style:none;
background:#ddd;
border-radius:3px;
padding:3px 5px 3px 5px;
margin:5px;
box-shadow: 0px 2px 0 #ccc ;
float:left;
}
ul li a{
font-weight:bold;
color:#666;
text-shadow:0px 1px 0px #fff;
}
.titlelink {
font-weight:bold;
color:#56728C;
text-shadow:0px 1px 0px #fff;
}
#footer{
min-height:100px;
}
</style>
<script type="text/javascript"
src="chrome://browser/content/abouthome/aboutHome.js"/>
<script type="text/javascript"
src="chrome://browser/content/contentSearchUI.js"/>
</head>
<body dir="&locale.dir;">
<div id="box">
<div id="box1">
<div class="spacer"/>
<div id="topSection">
<img src="chrome://branding/content/about-logo.png"/>
<div id="brandLogo"></div>
<div id="searchContainer">
<form name="searchForm" id="searchForm" action="https://duckduckgo.com/">
<input type="hidden" name="t" value="trisquel"/>
<div id="searchIconAndTextContainer">
<div id="searchIcon"/>
<input type="text" name="q" value="" id="searchText" maxlength="256"
autofocus="autofocus"/>
<input id="searchSubmit" type="submit" value="Search"/>
</form>
aria-label="&contentSearchInput.label;" autofocus="autofocus"/>
<input id="searchSubmit" type="button" onclick="onSearchSubmit(event)"
title="&contentSearchSubmit.tooltip;"/>
</div>
</div>
<div class="spacer"/>
<div id="launcher">
<button class="launchButton" id="downloads">&abouthome.downloadsButton.label;</button>
<button class="launchButton" id="bookmarks">&abouthome.bookmarksButton.label;</button>
<button class="launchButton" id="history">&abouthome.historyButton.label;</button>
<button class="launchButton" id="addons">&abouthome.addonsButton.label;</button>
<button class="launchButton" id="sync">&abouthome.syncButton.label;</button>
<button class="launchButton" id="settings">&abouthome.preferencesButtonUnix.label;</button>
<div id="restorePreviousSessionSeparator"/>
<button class="launchButton" id="restorePreviousSession">&historyRestoreLastSession.label;</button>
</div>
<div id="box2">
<div id="footer" style=" display: -moz-box; -moz-box-align: center; -moz-box-pack: center; width: 100%; background-color: hsla(0,0%,0%,.03); border-top: 1px solid hsla(0,0%,0%,.03); box-shadow: 0 2px 5px hsla(0,0%,0%,.1) inset, 0 -1px 0 hsla(0,0%,100%,.25);">
<p ><a class="titlelink" href="https://trisquel.info">Trisquel GNU/Linux</a>:</p>
<ul style="font-size:0.8em">
<li><a href="https://trisquel.info/forum">Forum</a></li>
<li><a href="https://trisquel.info/wiki">Wiki</a></li>
<li><a href="http://store.trisquel.info/">Store</a></li>
<li><a href="https://trisquel.info/donate">Donate</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 134 38">
<path d="M54.2,21.8c0,3.2-1.6,5.2-4.1,5.2s-3.9-2.2-3.9-5.1,1.5-4.9,3.9-4.9S54.2,18.4,54.2,21.8Zm61.1,3.5a1.7,1.7,0,0,0,2,1.9c1.7,0,3.5-1.2,3.6-4l-2.4-.2C116.8,23,115.3,23.4,115.3,25.3ZM134,0V38H0V0ZM39.2,26.6H37V19a5.4,5.4,0,0,0-5.7-5.8,5.6,5.6,0,0,0-5.4,3.6,5.4,5.4,0,0,0-5.4-3.6,5.5,5.5,0,0,0-5.1,2.8V13.6h-7v3.6h2.2v9.4H8.4v3.6H18.6V26.6H15.4V20.8c0-2.3.9-3.9,3.2-3.9s2.8,1.1,2.8,4v9.4h7V26.6H26.2V20.8c0-2.3.9-3.9,3.2-3.9s2.8,1.1,2.8,4v9.4h7Zm19.9-4.7c0-4.6-2.9-8.7-8.9-8.7s-8.9,4-8.9,8.9,3.5,8.4,8.7,8.4S59.1,27.2,59.1,21.9Zm18.7,2.5L74,24l-.8,2.6H67.9l9.2-10.5-.4-2.5H62.1l-.6,5.8,3.4.4.7-2.6h5.2L61.8,27.7l.5,2.5H76.8Zm8.5-.1h-5v6h5Zm0-10.7h-5v6h5ZM94,30.2l7.2-25.4H96.6L89.4,30.2Zm9.7,0,7.2-25.4h-4.7L99,30.2Zm23.8-.4V27.3h-.7c-.8,0-1.1-.3-1.1-1.3V18.9c0-3.8-3-5.6-6.6-5.6a16,16,0,0,0-7.1,1.5l-.6,3.8,3.8.4.5-1.9a5.2,5.2,0,0,1,2.5-.5c2.7,0,2.7,2,2.7,3.7v.6h-2.7c-3.8,0-7.7,1-7.7,5.1s2.7,4.8,5.1,4.8a6,6,0,0,0,5.3-3.3,3.4,3.4,0,0,0,3.6,3.3A6.4,6.4,0,0,0,127.5,29.8Z"/>
</svg>
......@@ -123,7 +123,7 @@ pref("browser.newtabpage.directory.source", "");
pref("browser.newtabpage.directory.ping", "");
pref("browser.newtabpage.introShown", true);
// Disable home snippets
pref("browser.aboutHomeSnippets.updateUrl", "data:text/html");
pref("browser.aboutHomeSnippets.updateUrl", "");
// Services
pref("gecko.handlerService.schemes.mailto.0.name", "");
......
......@@ -176,9 +176,11 @@ cp $DATA/bookmarks.html.in browser/locales/generic/profile/bookmarks.html.in
cp $DATA/searchplugins/*.xml debian/searchplugins/en-US/
cp $DATA/searchplugins/searchplugins.conf debian/config/
# install aboutabrowser extension
cp $DATA/aboutabrowser@trisquel.info -r debian
echo "debian/aboutabrowser@trisquel.info @MOZ_ADDONDIR@/extensions/" >> debian/abrowser.install.in
# install extensions
for extension in $(ls -1 $DATA/extensions/); do
cp $DATA/extensions/$extension -r debian
echo "debian/$extension @MOZ_ADDONDIR@/extensions/" >> debian/abrowser.install.in
done
# Disable newtab "What is this" popup and config button
cat << EOF >> browser/themes/linux/newtab/newTab.css
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment