Code Monkey home page Code Monkey logo

Comments (5)

pughboy avatar pughboy commented on August 19, 2024

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();" />';



from ip-ranges.

coolboygreatone avatar coolboygreatone commented on August 19, 2024

Thanks @pughboy this was helpful

from ip-ranges.

rdehler avatar rdehler commented on August 19, 2024

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

from ip-ranges.

viraj89 avatar viraj89 commented on August 19, 2024

@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. 😄

from ip-ranges.

rdehler avatar rdehler commented on August 19, 2024

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

from ip-ranges.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.