New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't see load Iframe button in new sfdc org. #2

Closed
pbforce opened this Issue Jul 1, 2015 · 5 comments

Comments

Projects
None yet
5 participants
@pbforce

pbforce commented Jul 1, 2015

I was using this package from last one year in different dev orgs, But today When I installed this package I don't see load iframe button . Can you explain how to enable that,

@pughboy

This comment has been minimized.

Show comment
Hide comment
@pughboy

pughboy Jul 31, 2015

This is due to the Summer 2015 release which now blocks css, javascript, etc. from components.

((Read about changes to home page component restrictions and Visual Force Areas here.))

I was able to get it to work with the following hack

  1. Install the package

  2. Configure the home default layout so that the ip range component is ordered as the last component showing in the layout

  3. In Chrome browser, open DevTools and go to the javascript console

  4. Paste the contents of the google doc (link below) into the console and hit [ENTER], you will see the buttons appear where they should have been if the JS wasn't blocked:

var startingPoint = 0;
var IP_MAX = 255;

function loadIframes() {
    var a = startingPoint;
    var docHTML = "<table class=\"list\" cellspacing=\"0\" border=\"0\" cellpadding=\"4\">";
    docHTML += "<tr class=\"headerRow\">";
    docHTML += "<th>IP Start</th>";
    docHTML += "<th>IP End</th>";
    docHTML += "<th>Status</th>";   
    docHTML += "<th>(iframe loads here)</th>";
    docHTML += "</tr>";
    while (a<=IP_MAX) {
        docHTML += "<tr>";

        docHTML += "<td>"+a+".0.0.0</td>";
        docHTML += "<td>"+(a+1)+".255.255.255</td>";
        docHTML += "<td id=\"iframe"+a+"_Updated\">Loading...</td>";
        docHTML += "<td><iframe onload=\"parent.document.getElementById(this.name+'_Updated').innerHTML = 'iframe Loaded.';\" id=\"iframe"+a+"\" name=\"iframe"+a+"\" src=\"/05G/e?retURL=%2F05G&IpStartAddress="+a+".0.0.0&IpEndAddress="+(a+1)+".255.255.255&save=1\" width=\"0\" height=\"0\"  frameborder=\"0\"></iframe></td>";
        docHTML += "</tr>";
        a = a+2;
    }
    docHTML += "</table>";
    document.getElementById("output").innerHTML = docHTML;
}

function saveIPs() {
    saveIP(startingPoint);
}
function saveIP(ip) {
        var frame = document.getElementById("iframe"+ip);
        document.getElementById('iframe'+ip+'_Updated').innerHTML = "Saving IP Range...";
        var insideFrame = frame.contentWindow;
        var confirmationKeyElement = insideFrame.document.getElementById("_CONFIRMATIONTOKEN");
        if (confirmationKeyElement != null) {
            frame.onload="";
            var confirmationKey = confirmationKeyElement.value;
            insideFrame.document.location.href = insideFrame.document.location.href+"&_CONFIRMATIONTOKEN="+confirmationKey;
            document.getElementById("iframe"+ip+"_Updated").innerHTML = 'Completed.';
        } else {
            document.getElementById("iframe"+ip+"_Updated").innerHTML = 'Failed.';
        }

        if (ip <= IP_MAX-2) {
            setTimeout("saveIP("+(ip+2)+")", 1000);
        }
}
var x = document.getElementsByClassName("pbButton"); 
x[x.length - 1].innerHTML = '<input type="button" class="btn" value="Load iFrames" onclick="loadIframes();" /><input type="button" class="btn" value="Save IPs" onclick="saveIPs();" />';



pughboy commented Jul 31, 2015

This is due to the Summer 2015 release which now blocks css, javascript, etc. from components.

((Read about changes to home page component restrictions and Visual Force Areas here.))

I was able to get it to work with the following hack

  1. Install the package

  2. Configure the home default layout so that the ip range component is ordered as the last component showing in the layout

  3. In Chrome browser, open DevTools and go to the javascript console

  4. Paste the contents of the google doc (link below) into the console and hit [ENTER], you will see the buttons appear where they should have been if the JS wasn't blocked:

var startingPoint = 0;
var IP_MAX = 255;

function loadIframes() {
    var a = startingPoint;
    var docHTML = "<table class=\"list\" cellspacing=\"0\" border=\"0\" cellpadding=\"4\">";
    docHTML += "<tr class=\"headerRow\">";
    docHTML += "<th>IP Start</th>";
    docHTML += "<th>IP End</th>";
    docHTML += "<th>Status</th>";   
    docHTML += "<th>(iframe loads here)</th>";
    docHTML += "</tr>";
    while (a<=IP_MAX) {
        docHTML += "<tr>";

        docHTML += "<td>"+a+".0.0.0</td>";
        docHTML += "<td>"+(a+1)+".255.255.255</td>";
        docHTML += "<td id=\"iframe"+a+"_Updated\">Loading...</td>";
        docHTML += "<td><iframe onload=\"parent.document.getElementById(this.name+'_Updated').innerHTML = 'iframe Loaded.';\" id=\"iframe"+a+"\" name=\"iframe"+a+"\" src=\"/05G/e?retURL=%2F05G&IpStartAddress="+a+".0.0.0&IpEndAddress="+(a+1)+".255.255.255&save=1\" width=\"0\" height=\"0\"  frameborder=\"0\"></iframe></td>";
        docHTML += "</tr>";
        a = a+2;
    }
    docHTML += "</table>";
    document.getElementById("output").innerHTML = docHTML;
}

function saveIPs() {
    saveIP(startingPoint);
}
function saveIP(ip) {
        var frame = document.getElementById("iframe"+ip);
        document.getElementById('iframe'+ip+'_Updated').innerHTML = "Saving IP Range...";
        var insideFrame = frame.contentWindow;
        var confirmationKeyElement = insideFrame.document.getElementById("_CONFIRMATIONTOKEN");
        if (confirmationKeyElement != null) {
            frame.onload="";
            var confirmationKey = confirmationKeyElement.value;
            insideFrame.document.location.href = insideFrame.document.location.href+"&_CONFIRMATIONTOKEN="+confirmationKey;
            document.getElementById("iframe"+ip+"_Updated").innerHTML = 'Completed.';
        } else {
            document.getElementById("iframe"+ip+"_Updated").innerHTML = 'Failed.';
        }

        if (ip <= IP_MAX-2) {
            setTimeout("saveIP("+(ip+2)+")", 1000);
        }
}
var x = document.getElementsByClassName("pbButton"); 
x[x.length - 1].innerHTML = '<input type="button" class="btn" value="Load iFrames" onclick="loadIframes();" /><input type="button" class="btn" value="Save IPs" onclick="saveIPs();" />';



@coolboygreatone

This comment has been minimized.

Show comment
Hide comment
@coolboygreatone

coolboygreatone Aug 19, 2015

Thanks @pughboy this was helpful

Thanks @pughboy this was helpful

@rdehler

This comment has been minimized.

Show comment
Hide comment
@rdehler

rdehler Sep 9, 2015

Owner

Thanks @pughboy -- I'll refer people here in the short term.

Owner

rdehler commented Sep 9, 2015

Thanks @pughboy -- I'll refer people here in the short term.

@viraj89

This comment has been minimized.

Show comment
Hide comment
@viraj89

viraj89 Feb 12, 2016

@pughboy & @rdehler A great hack guys. I see it working till button appearing; but once I click the Load iframe button, the page reloads and crashes.
capture

What can we do it work it again? Verfication code is often painful, we all know. 😄

viraj89 commented Feb 12, 2016

@pughboy & @rdehler A great hack guys. I see it working till button appearing; but once I click the Load iframe button, the page reloads and crashes.
capture

What can we do it work it again? Verfication code is often painful, we all know. 😄

@rdehler

This comment has been minimized.

Show comment
Hide comment
@rdehler

rdehler Mar 3, 2016

Owner

Permanent solution: this repository is to be retired, and using this instead: https://github.com/rdehler/sfdc-whitelist-ips-chrome

Owner

rdehler commented Mar 3, 2016

Permanent solution: this repository is to be retired, and using this instead: https://github.com/rdehler/sfdc-whitelist-ips-chrome

@rdehler rdehler closed this Mar 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment