Skip to content

Instantly share code, notes, and snippets.

@andrzj
andrzj / gist:7e0e2c99384b2c034894c2af1a549aa1
Created July 3, 2017 14:34 — forked from jaydson/gist:1780598
How to detect a click event on a cross domain iframe
var myConfObj = {
iframeMouseOver : false
}
window.addEventListener('blur',function(){
if(myConfObj.iframeMouseOver){
console.log('Wow! Iframe Click!');
}
});
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){
@andrzj
andrzj / wwd.js
Last active June 5, 2016 17:22
Windows wallpaper download script
var saveToDisk = function (fileURL, fileName) {
// for non-IE
if (!window.ActiveXObject) {
var save = document.createElement('a');
save.href = fileURL;
save.target = '_blank';
save.download = fileName || 'unknown';
var event = document.createEvent('Event');
event.initEvent('click', true, true);