projects
/
GM_direct_download_links.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a note about the "download" attribute for anchors
[GM_direct_download_links.git]
/
direct_download_links.user.js
diff --git
a/direct_download_links.user.js
b/direct_download_links.user.js
index
8253247
..
e1f17f3
100644
(file)
--- a/
direct_download_links.user.js
+++ b/
direct_download_links.user.js
@@
-28,6
+28,7
@@
// @include http://trovacinema.repubblica.it/*
// @include http://www.kataweb.it/tvzap/*
// @include http://www.rai.tv/*
// @include http://trovacinema.repubblica.it/*
// @include http://www.kataweb.it/tvzap/*
// @include http://www.rai.tv/*
+// @include http://soundcloud.com/*
// ==/UserScript==
//
// ==/UserScript==
//
@@
-38,6
+39,8
@@
* the regexp starting from a glob line.
* - use xpath instead of regexp like in http://a32.me/2009/11/greasemonkey/
* - use jquery, like shown in http://a32.me/2009/11/greasemonkey/
* the regexp starting from a glob line.
* - use xpath instead of regexp like in http://a32.me/2009/11/greasemonkey/
* - use jquery, like shown in http://a32.me/2009/11/greasemonkey/
+ * - Support the "download" attribute for anchors:
+ * http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#downloading-resources
*/
/* Fields supported by the "site" object.
*/
/* Fields supported by the "site" object.
@@
-110,6
+113,12
@@
var supported_sites = [
processURL: _rai_get_actual_url,
linkDest: 'Player',
},
processURL: _rai_get_actual_url,
linkDest: 'Player',
},
+ {
+ locationRegexp: /^http:\/\/soundcloud.com\/.*$/,
+ urlContainer: 'main-content-inner',
+ urlRegexp: /"streamUrl":"([^"]*)"/,
+ linkDest: 'main-content-inner',
+ },
];
/* Apply different rules to different sites */
];
/* Apply different rules to different sites */
@@
-212,6
+221,7
@@
function _add_link(e) {
style += ' border: 2px solid red;'
style += ' float: right; font-size: large;';
style += ' padding: .5em; margin: 1em;'
style += ' border: 2px solid red;'
style += ' float: right; font-size: large;';
style += ' padding: .5em; margin: 1em;'
+ style += ' position: relative; z-index: 1000;'
download_link.setAttribute('style', style);
destination.insertBefore(download_link, destination.firstChild);
download_link.setAttribute('style', style);
destination.insertBefore(download_link, destination.firstChild);