From 7859a9131fcda359265dc16ef55933e5ed218119 Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Date: Fri, 10 May 2019 19:05:20 -0400 Subject: Updated extensions bundle --- data/extensions/google_drive@0xbeef.coffee/License | 8 ++ .../META-INF/manifest.mf | 32 +++++++ .../META-INF/mozilla.rsa | Bin 0 -> 4183 bytes .../google_drive@0xbeef.coffee/META-INF/mozilla.sf | 4 + .../google_drive@0xbeef.coffee/google_drive.js | 105 +++++++++++++++++++++ .../google_drive@0xbeef.coffee/icons/L4Libre.png | Bin 0 -> 238 bytes .../icons/L4Libre128.png | Bin 0 -> 1283 bytes .../google_drive@0xbeef.coffee/icons/L4Libre48.png | Bin 0 -> 402 bytes .../google_drive@0xbeef.coffee/manifest.json | 29 ++++++ 9 files changed, 178 insertions(+) create mode 100644 data/extensions/google_drive@0xbeef.coffee/License create mode 100644 data/extensions/google_drive@0xbeef.coffee/META-INF/manifest.mf create mode 100644 data/extensions/google_drive@0xbeef.coffee/META-INF/mozilla.rsa create mode 100644 data/extensions/google_drive@0xbeef.coffee/META-INF/mozilla.sf create mode 100644 data/extensions/google_drive@0xbeef.coffee/google_drive.js create mode 100644 data/extensions/google_drive@0xbeef.coffee/icons/L4Libre.png create mode 100644 data/extensions/google_drive@0xbeef.coffee/icons/L4Libre128.png create mode 100644 data/extensions/google_drive@0xbeef.coffee/icons/L4Libre48.png create mode 100644 data/extensions/google_drive@0xbeef.coffee/manifest.json (limited to 'data/extensions/google_drive@0xbeef.coffee') diff --git a/data/extensions/google_drive@0xbeef.coffee/License b/data/extensions/google_drive@0xbeef.coffee/License new file mode 100644 index 0000000..638bb51 --- /dev/null +++ b/data/extensions/google_drive@0xbeef.coffee/License @@ -0,0 +1,8 @@ +Copyright (C) 2017 Nathan Nichols + +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 NATHAN NICHOLS 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. + diff --git a/data/extensions/google_drive@0xbeef.coffee/META-INF/manifest.mf b/data/extensions/google_drive@0xbeef.coffee/META-INF/manifest.mf new file mode 100644 index 0000000..d9f7b9a --- /dev/null +++ b/data/extensions/google_drive@0xbeef.coffee/META-INF/manifest.mf @@ -0,0 +1,32 @@ +Manifest-Version: 1.0 + +Name: google_drive.js +Digest-Algorithms: MD5 SHA1 +MD5-Digest: duk91DVUHS83P64lVwfamw== +SHA1-Digest: aM2klujxFOr+bFaD7PXd+izgCCY= + +Name: License +Digest-Algorithms: MD5 SHA1 +MD5-Digest: o1+NLuXuBdXDUPbqMKclVg== +SHA1-Digest: 9neKP3yy2up5cLrNOoXL0zOPkJY= + +Name: manifest.json +Digest-Algorithms: MD5 SHA1 +MD5-Digest: D+WP8+P9hj/FtW2D973svQ== +SHA1-Digest: 3zhyX2q4yAi2VAMf6cz213TWDyc= + +Name: icons/L4Libre.png +Digest-Algorithms: MD5 SHA1 +MD5-Digest: q3yb3JBgG37iwtqsbdifEQ== +SHA1-Digest: g9xXtW7KmY0kT9CJhiEc24eApUw= + +Name: icons/L4Libre128.png +Digest-Algorithms: MD5 SHA1 +MD5-Digest: HuOWoeJwSBaX2AjC64b13g== +SHA1-Digest: FRHLIUgqzDFxwsPz1xEw7LgLwxE= + +Name: icons/L4Libre48.png +Digest-Algorithms: MD5 SHA1 +MD5-Digest: zmyb8Gjl/pQrCjin3xTqxg== +SHA1-Digest: BnrBIabVdDHRvAczhVg7e/lVcjc= + diff --git a/data/extensions/google_drive@0xbeef.coffee/META-INF/mozilla.rsa b/data/extensions/google_drive@0xbeef.coffee/META-INF/mozilla.rsa new file mode 100644 index 0000000..10a9be8 Binary files /dev/null and b/data/extensions/google_drive@0xbeef.coffee/META-INF/mozilla.rsa differ diff --git a/data/extensions/google_drive@0xbeef.coffee/META-INF/mozilla.sf b/data/extensions/google_drive@0xbeef.coffee/META-INF/mozilla.sf new file mode 100644 index 0000000..5ccff89 --- /dev/null +++ b/data/extensions/google_drive@0xbeef.coffee/META-INF/mozilla.sf @@ -0,0 +1,4 @@ +Signature-Version: 1.0 +MD5-Digest-Manifest: gKo1uIN/QaixjtCXUhIOhg== +SHA1-Digest-Manifest: uX2UjTidQeTHftLmF3xrE5SM/SE= + diff --git a/data/extensions/google_drive@0xbeef.coffee/google_drive.js b/data/extensions/google_drive@0xbeef.coffee/google_drive.js new file mode 100644 index 0000000..be4398c --- /dev/null +++ b/data/extensions/google_drive@0xbeef.coffee/google_drive.js @@ -0,0 +1,105 @@ +/* +Copyright (C) 2017 Nathan Nichols + +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 NATHAN NICHOLS 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. +*/ + +function parseURL(a){ + let url = new URL(a); + var result = Object.create(null); + for(let i of url.searchParams) { + result[i[0]] = i[1]; + } + return JSON.stringify(result, undefined, 4); +} +var id; +var url; +function form_check(){ + console.log("boop"); + var format = ""; + var input = document.getElementsByTagName("input"); + if(input[input.length-1].value != "Expected 3 letter file extension"){ + format = input[input.length-1].value; + } else{ + for(var i = 0; i < input.length-1; i++){ + if(input[i].value != ""){ + format = input[i].value; + break; + } + } + if(format == ""){ + return 0; + } + } + + // Supposed to look like this: + // https://docs.google.com/document/export?format=FORMAT&id=ID + // Thanks to Alyssa Rosenzweig. + var new_url = 'https://docs.google.com/document/export?format='+format+'&id='+id; + document.location.assign(new_url); + return 0; +} + + +var contains_apostrophe = "You don't really want to store your data in a cloudy service do you?"; +var opts_form = + '
'+ + '

Google Drive without non-free Javascript

'+ + ' '+contains_apostrophe+'


'+ + '
'+ + ' Please select the format to download in:

'+ + ' Plain text ("txt")
'+ + ' ODT ("odt")

'+ + ' Or try to get the document in a different format, '+ + ' ("png", "avi", "pdf", etc..):

'+ + '

'+ + '
'+ + ''+ + ''+ + ''; + +// see if its a document or not. +function check_valid(){ + id = "no ID found."; + var url_arr = document.location.href.split("/"); + + for(var i = 0; i < url_arr.length-1; i++){ + if(url_arr[i] == "d"){ + id = url_arr[i+1]; + break; + } + } + if(id == "no ID found."){ + // do nothing because it could be an info page or something + console.log("no id found."); + return false; + } + else { + return true; + } +} + + + +function main(){ + if(check_valid()){ + console.log("---------------------------------"+Date.now()+":Detected Google Drive."+"---------------------------------"); + window.stop(); + document.head.innerHTML = ""; + document.body.innerHTML = opts_form; + document.body.style.textAlign = "center"; + document.getElementById("opts").style.textAlign = "left"; + //document.getElementsById("opts").style.float = "left"; + document.body.style.marginTop = "2%" + document.body.style.marginLeft = "25%" + document.body.style.marginRight = "25%" + document.getElementById("submit").addEventListener("click",form_check); + } + return 0; +} +main(); diff --git a/data/extensions/google_drive@0xbeef.coffee/icons/L4Libre.png b/data/extensions/google_drive@0xbeef.coffee/icons/L4Libre.png new file mode 100644 index 0000000..216e051 Binary files /dev/null and b/data/extensions/google_drive@0xbeef.coffee/icons/L4Libre.png differ diff --git a/data/extensions/google_drive@0xbeef.coffee/icons/L4Libre128.png b/data/extensions/google_drive@0xbeef.coffee/icons/L4Libre128.png new file mode 100644 index 0000000..04f8d63 Binary files /dev/null and b/data/extensions/google_drive@0xbeef.coffee/icons/L4Libre128.png differ diff --git a/data/extensions/google_drive@0xbeef.coffee/icons/L4Libre48.png b/data/extensions/google_drive@0xbeef.coffee/icons/L4Libre48.png new file mode 100644 index 0000000..0470a78 Binary files /dev/null and b/data/extensions/google_drive@0xbeef.coffee/icons/L4Libre48.png differ diff --git a/data/extensions/google_drive@0xbeef.coffee/manifest.json b/data/extensions/google_drive@0xbeef.coffee/manifest.json new file mode 100644 index 0000000..0f5141f --- /dev/null +++ b/data/extensions/google_drive@0xbeef.coffee/manifest.json @@ -0,0 +1,29 @@ +{ + "manifest_version": 2, + "name": "LibreJS Google Drive", + "version": "1.0", + "author": "Nathan Nichols", + "id": "LibrejsDrive@0xbeef.coffee", + "description": "Makes Google Drive usable with LibreJS.", + "icons": { + "16": "icons/L4Libre.png", + "48": "icons/L4Libre48.png", + "128": "icons/L4Libre128.png" + }, + "applications": { + "gecko": { + "id": "google_drive@0xbeef.coffee", + "strict_min_version": "42.0" + } + }, + "content_scripts": [ + { + "matches": [ + "*://docs.google.com/document/*" + ], + "js": [ + "google_drive.js" + ] + } + ] +} -- cgit v1.2.3