Skip to content

Commit

Permalink
Added Firefox add-on
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Oct 12, 2014
1 parent 208becb commit e7b88ff
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/screenshots

*.zip
*.crx
*.pem
*.pem
*.xpi
*.db
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion manifest.json → Chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"FB fixed navbar",
"description":"",
"description":"Freezes left navigation pane on Facebook",
"version":"0.0.4",
"manifest_version":2,
"author": "Philipp Schirmer",
Expand Down
24 changes: 24 additions & 0 deletions Firefox/data/fixed_navbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#scrollbarHider {
overflow: hidden;
top: 95px;
bottom: 0px;
position: fixed;
margin-left: -20px;
margin-top: 12px;
margin-bottom: -12px;
width: 181px;
}

#navigationWrapper {
overflow: auto;
height: 100%;
padding-right: 5000px;
padding-left: 20px;
width: 181px;
position: absolute;
top: -12px;
}

#leftColWrapper {
position: fixed;
}
22 changes: 22 additions & 0 deletions Firefox/data/fixed_navbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
setInterval(fixNavbar, 50);
function fixNavbar() {
var pagelet_navigation = document.getElementById('pagelet_navigation');
if (document.getElementById('leftColWrapper') === null && pagelet_navigation !== null) {
var mainContainer = document.getElementById('mainContainer');
var leftCol = document.getElementById('leftCol');
var contentCol = document.getElementById('contentCol');
var leftColWrapper = document.createElement('div');
var scrollbarHider = document.createElement('div');
var navigationWrapper = document.createElement('div');
leftColWrapper.id = 'leftColWrapper';
scrollbarHider.id = 'scrollbarHider';
navigationWrapper.id = 'navigationWrapper';
mainContainer
.appendChild(leftColWrapper)
.appendChild(leftCol)
.appendChild(scrollbarHider)
.appendChild(navigationWrapper)
.appendChild(pagelet_navigation);
mainContainer.appendChild(contentCol);
}
}
9 changes: 9 additions & 0 deletions Firefox/lib/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var data = require("sdk/self").data;
var pageMod = require("sdk/page-mod");

pageMod.PageMod({
include: "*.facebook.com",
contentScriptFile: data.url("fixed_navbar.js"),
contentStyleFile: data.url("fixed_navbar.css"),
contentScriptWhen: "end"
});
9 changes: 9 additions & 0 deletions Firefox/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "fb-fixed-navbar",
"title": "FB-fixed-navbar",
"id": "jid1-9prtREtF6cjLPA",
"description": "Freezes left navigation pane on Facebook",
"author": "Philipp Schirmer",
"license": "MPL 2.0",
"version": "0.0.4"
}
12 changes: 12 additions & 0 deletions Firefox/test/test-main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var main = require("./main");

exports["test main"] = function(assert) {
assert.pass("Unit test running!");
};

exports["test main async"] = function(assert, done) {
assert.pass("async Unit test running!");
done();
};

require("sdk/test").run(exports);

0 comments on commit e7b88ff

Please sign in to comment.