Created
August 5, 2011 01:46
-
-
Save XP1/1126767 to your computer and use it in GitHub Desktop.
Enhance Yahoo! Mail: In Yahoo! Mail, opens the download iframe in a new window so that the attachment can be opened if the file type is associated with the Opera browser.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Enhance Yahoo! Mail | |
// @version 1.00 | |
// @description In Yahoo! Mail, opens the download iframe in a new window so that the attachment can be opened if the file type is associated with the Opera browser. | |
// @author XP1 (https://github.com/XP1/) | |
// @namespace https://gist.github.com/1126767/ | |
// @include http*://mail.yahoo.*/* | |
// @include http*://*.mail.yahoo.*/* | |
// @include http*://mail.yimg.*/* | |
// @include http*://*.mail.yimg.*/* | |
// @include http*://yahooapis.*/* | |
// @include http*://*.yahooapis.*/* | |
// ==/UserScript== | |
/*jslint browser: true, vars: true, white: true, maxerr: 50, indent: 4 */ | |
(function (topWindow) | |
{ | |
"use strict"; | |
if (window.self !== topWindow) | |
{ | |
return; | |
} | |
function disableDownloadIframe() | |
{ | |
topWindow.addEventListener("DOMNodeInserted", function (event) | |
{ | |
var sourceElement = event.srcElement; | |
if (sourceElement.tagName.toLowerCase() === "iframe" && sourceElement.hasAttribute("id") && sourceElement.getAttribute("id").indexOf("#dlFrame") !== -1) | |
{ | |
var downloadLink = sourceElement.getAttribute("src"); | |
sourceElement.parentNode.removeChild(sourceElement); | |
window.open(downloadLink); | |
} | |
}, false); | |
} | |
disableDownloadIframe(); | |
}(window.top)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Enhance Yahoo! Mail | |
// @version 1.0 | |
// @description In Yahoo! Mail, opens the download iframe in a new window so that the attachment can be opened if the file type is associated with the Opera browser. | |
// @author XP1 (https://github.com/XP1/) | |
// @namespace https://gist.github.com/1126767/ | |
// @include http*://mail.yahoo.*/* | |
// @include http*://*.mail.yahoo.*/* | |
// @include http*://mail.yimg.*/* | |
// @include http*://*.mail.yimg.*/* | |
// @include http*://yahooapis.*/* | |
// @include http*://*.yahooapis.*/* | |
// ==/UserScript== | |
/*jslint browser: true, vars: true, white: true, maxerr: 50, indent: 4 */ | |
(function (topWindow) | |
{ | |
"use strict"; | |
if (window.self === topWindow) | |
{ | |
var disableDownloadIframe = function () | |
{ | |
topWindow.addEventListener("DOMNodeInserted", function (event) | |
{ | |
var sourceElement = event.srcElement; | |
if (sourceElement.tagName.toLowerCase() === "iframe" && sourceElement.hasAttribute("id") && sourceElement.getAttribute("id").indexOf("#dlFrame") !== -1) | |
{ | |
var downloadLink = sourceElement.getAttribute("src"); | |
sourceElement.parentNode.removeChild(sourceElement); | |
window.open(downloadLink); | |
} | |
}, false); | |
}; | |
disableDownloadIframe.call(this); | |
} | |
}(window.top)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment