How to defer loading of a Norton Secure Site Seal?

南楼画角 提交于 2019-12-03 07:48:40

This is killing my business too. Seriously... +2 to +20 seconds per page load. AFYS?

We are switching to hosting the image locally but still linking to the original URL on Norton. Don't do this. Mark this answer down. It's wrong. It's illegal. But it's practical.

https://trustsealinfo.verisign.com/splash?form_file=fdf/splash.fdf&dn=WWW.EXAMPLE.COM&lang=en

UPDATE:

Real solution is to:

  • Call 877-438-8776, x2, x1
  • Tell them seal is slow and you have > 10,000 visits per day on your site
  • They give you media kit to install on your own site

If you look at the code, they are using document.write.

The way I handle this is the following

document.write = function(s) {
    document.getElementById('seal-wrapper').innerHTML += s;
}

Of course this is a very simple hack which only works when there's a single script which uses document.write and you know where you want it to be written to.

I've tried to load seal into a iframe and then put it to where it's intended to be. It works for me. With the help of jQuery. Here it is:

Create .js file (I called it hackseal.js)

$(function () {
    if (typeof(vs_hack) !== 'undefined') {
        return;
    }
    vs_hack = true;
    var iframe = document.createElement('iframe');
    var html = '<script src="url_to_verysign" type="text/javascript"></script>';
    iframe.style.display = 'none';
    document.body.appendChild(iframe);
    iframe.contentWindow.document.open();
    iframe.contentWindow.document.write(html);
    iframe.contentWindow.document.close();
    iframe.onload = function () {
        var copy = ['dn', 'lang', 'tpt', 'vrsn_style', 'splash_url', 'seal_url', 'u1', 'u2', 'sopener', 'vrsn_splash', 'ver', 'v_ua', 're', 'v_old_ie', 'v_mact', 'v_mDown', 'v_resized'];
        for (var copy_i in copy) {
            window[copy[copy_i]] = iframe.contentWindow[copy[copy_i]];
        }
        $('script#seal-sign').replaceWith(iframe.contentWindow.document.body.innerHTML);
    }
});

Change the original code from this

<script type="text/javascript" src="url_to_verysign"></script>

to this

<script id="seal-sign" type="text/javascript" src="url_to_hackseal.js"></script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!