Skip to content

Instantly share code, notes, and snippets.

@gonter
Last active August 29, 2015 14:13
Show Gist options
  • Save gonter/d40829048d83910a5e60 to your computer and use it in GitHub Desktop.
Save gonter/d40829048d83910a5e60 to your computer and use it in GitHub Desktop.
replace iframe link with https version
// ==UserScript==
// @name rdsiframe
// @namespace urxn.at
// @description force https iframe
// @include //www.research-data-survey.at/
// @version 1
// @grant none
// ==/UserScript==
var re_http= new RegExp("^http:");
var node_list = document.getElementsByTagName('iframe');
for (var i = 0, j = node_list.length; i < j; i++)
{
var node = node_list[i];
var src= node.getAttribute('src');
if (src.match(re_http))
{
var new_src= src.replace('http:', 'https:')
node.setAttribute('src', new_src);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment