Skip to content

Commit

Permalink
Initial version supporting just zeit.de
Browse files Browse the repository at this point in the history
  • Loading branch information
toto committed Feb 20, 2011
0 parents commit c00a0ac
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Info.plist
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Author</key>
<string>Thomas Kollbach</string>
<key>CFBundleDisplayName</key>
<string>FullPage</string>
<key>CFBundleIdentifier</key>
<string>io.bits.safariextension.fullpage</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>Chrome</key>
<dict/>
<key>Content</key>
<dict>
<key>Scripts</key>
<dict>
<key>Start</key>
<array>
<string>fullpage.js</string>
</array>
</dict>
<key>Whitelist</key>
<array>
<string>http*.://*.zeit.de/*</string>
</array>
</dict>
<key>Description</key>
<string>Displays the full page on news sites by default</string>
<key>ExtensionInfoDictionaryVersion</key>
<string>1.0</string>
<key>Permissions</key>
<dict>
<key>Website Access</key>
<dict>
<key>Include Secure Pages</key>
<true/>
<key>Level</key>
<string>All</string>
</dict>
</dict>
<key>Website</key>
<string>http://fullpage.bits.io</string>
</dict>
</plist>
5 changes: 5 additions & 0 deletions README.md
@@ -0,0 +1,5 @@
Automatically makes news webpages have full page links.

Supported Sites so far:

* [zeit.de](http://zeit.de)
39 changes: 39 additions & 0 deletions fullpage.js
@@ -0,0 +1,39 @@
/*
httpsecure.js
Written by toto toto.
Source hosted on Github at https://github.com/toto/FullPage
License: CC BY-SA-NC 3.0, See README.md for more information.
*/

function $(q, root, single) {
if (root && typeof root == 'string') { root = $(root, null, true); }
root = root || document;
if (q[0]=='#') { return root.getElementById(q.substr(1)); }
else if (q[0]=='/' || (q[0]=='.' && q[1]=='/')) {
if (single) { return document.evaluate(q, root, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; }
return document.evaluate(q, root, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
}
else if (q[0]=='.') { return root.getElementsByClassName(q.substr(1)); }
return root.getElementsByTagName(q);
}

function appendAllZeit(){
var links = $("//a[contains(@href,'zeit.de')]");
for (var i=0; i < links.snapshotLength; i++) {
if (links.snapshotItem(i).href.indexOf('page=all') == -1) {
links.snapshotItem(i).href = links.snapshotItem(i).href + "?page=all";
}

}
}


document.addEventListener(
'load',
function() {
appendAllZeit();
},
true
);

0 comments on commit c00a0ac

Please sign in to comment.