function getTargetOrigin()

in salesforce/canvas/public/javascripts/canvas-all.js [961:979]


    function getTargetOrigin(to) {
      var h;
      if (to === '*') {
        return to;
      }
      if (!$$.isNil(to)) {
        h = $$.stripUrl(to);
        purl = $$.startsWithHttp(h, purl);
        if (purl) {
          return purl;
        }
      }
      h = $$.document().location.hash;
      if (h) {
        h = decodeURIComponent(h.replace(/^#/, ''));
        purl = $$.startsWithHttp(h, purl);
      }
      return purl;
    }