Created
June 20, 2015 16:00
-
-
Save rolandcrosby/17ccf63679fcf1a6d49b to your computer and use it in GitHub Desktop.
get instagram url
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
( | |
function() { | |
function getSrc() { | |
var el = document.querySelector('div[role=dialog]'); | |
if (el == null) { | |
el = document; | |
} | |
var media = el.querySelector('video'); | |
if (media == null) { | |
media = el.querySelector('img[id]'); | |
} | |
return media.src; | |
} | |
window.location = getSrc(); | |
} | |
)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment