Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Add extension source, license, and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Nateowami committed Feb 13, 2017
1 parent 1513292 commit 07430f1
Show file tree
Hide file tree
Showing 8 changed files with 3,038 additions and 0 deletions.
31 changes: 31 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Some portions of this software (specifically, files in the "lib" directory)
are subject to a different copyright than the rest of the software, but are used
with permission. See the license files in the "lib" directory for the exact
license on each file.

The original version of the file "blindfold.js" (originally by a different name)
is a part of the "gmail-chrome-extension-boilerplate" project and is Copyright
(c) 2017 Kartik Talwar.

MIT License

Original work Copyright (c) 2017 Kartik Talwar
Modified work, and all other work unless otherwise noted Copyright (c) 2017
Nathaniel Paulus

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.
44 changes: 44 additions & 0 deletions blindfold.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* eslint-env browser */
/* global Gmail */
/* eslint no-undef: "error" */

var gmail;

function refresh(f) {
if( (/in/.test(document.readyState)) || (typeof Gmail === 'undefined') ) {
setTimeout('refresh(' + f + ')', 10);
} else {
f();
}
}

function info(msg) {
console.info("Blindfold: " + msg);
}

var main = function(){
gmail = new Gmail();
info('Initialized');

gmail.observe.before('send_message', function(url, body, data, xhr){
info('Message sending detected');
var body_params = xhr.xhrParams.body_params;
var ccCount = body_params.cc ? (typeof body_params.cc === 'array' ? body_params.cc.length : 1) : 0;
var toCount = body_params.to ? (typeof body_params.to === 'array' ? body_params.to.length : 1) : 0;
var total = toCount + ccCount;

if(total > 1) {
info('Prompting before sending this message');
if(!confirm('Send a message to ' + total + ' recepiants in to and carbon copy fields?')) {
xhr.abort();
info('Canceling send as instructed by user');
}
else info('Continuing with send as instructed by user');
}
else info('Not prompting before sending this message');
})

}


refresh(main);
19 changes: 19 additions & 0 deletions content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var scripts = ['lib/jquery-3.1.1.min.js', 'lib/gmail.js', 'blindfold.js'];

scripts.forEach(function (script) {
var tag = document.createElement('script');
tag.src = chrome.extension.getURL(script);
(document.head || document.documentElement).appendChild(tag);
});

// var j = document.createElement('script');
// j.src = chrome.extension.getURL('jquery-1.10.2.min.js');
// (document.head || document.documentElement).appendChild(j);
//
// var g = document.createElement('script');
// g.src = chrome.extension.getURL('gmail.js');
// (document.head || document.documentElement).appendChild(g);
//
// var s = document.createElement('script');
// s.src = chrome.extension.getURL('main.js');
// (document.head || document.documentElement).appendChild(s);
22 changes: 22 additions & 0 deletions lib/LICENSE-GMAILJS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The following license applies to the file gmail.js:

The MIT License (MIT)

Copyright (c) 2014 Kartik Talwar

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.
43 changes: 43 additions & 0 deletions lib/LICENSE-JQUERY.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
The following license applies to the jQuery file in this project. The exact file
name may change from time to time due to containing the jQuery version number,
but should be found in the "lib" directory and contain "jquery" in the name.
Note that the other files the license refers to ("except as documented below")
to are not reproduced in this project. Beginning of license:

Copyright JS Foundation and other contributors, https://js.foundation/

This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery

The following license applies to all parts of this software except as
documented below:

====

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.

====

All files located in the node_modules and external directories are
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.

Loading

0 comments on commit 07430f1

Please sign in to comment.