get nativeXhr from iframe document not from current document directly like XhrTransport
18495
function () {
            var self = this, c = self.io.config, uri = c.uri, hostname = uri.hostname, iframe, iframeUri, iframeDesc = iframeMap[hostname];
            var proxy = PROXY_PAGE;
            if (c.xdr && c.xdr.subDomain && c.xdr.subDomain.proxy) {
                proxy = c.xdr.subDomain.proxy;
            }
            if (iframeDesc && iframeDesc.ready) {
                self.nativeXhr = XhrTransportBase.nativeXhr(0, iframeDesc.iframe.contentWindow);
                if (self.nativeXhr) {
                    self.sendInternal();
                } else {
                    LoggerManager.error('document.domain not set correctly!');
                }
                return;
            }
            if (!iframeDesc) {
                iframeDesc = iframeMap[hostname] = {};
                iframe = iframeDesc.iframe = doc.createElement('iframe');
                Dom.css(iframe, {
                    position: 'absolute',
                    left: '-9999px',
                    top: '-9999px'
                });
                Dom.prepend(iframe, doc.body || doc.documentElement);
                iframeUri = {};
                iframeUri.protocol = uri.protocol;
                iframeUri.host = uri.host;
                iframeUri.pathname = proxy;
                iframe.src = url.stringify(iframeUri);
            } else {
                iframe = iframeDesc.iframe;
            }
            Event.on(iframe, 'load', _onLoad, self);
        }
575538
function () {

            var oIFrame = this.iframe,
                oElement = this.element,
                nOffset = Overlay.IFRAME_OFFSET,
                nDimensionOffset = (nOffset * 2),
                aXY;

            if (oIFrame) {
                // Size <iframe>
                oIFrame.style.width = (oElement.offsetWidth + nDimensionOffset + "px");
                oIFrame.style.height = (oElement.offsetHeight + nDimensionOffset + "px");

                // Position <iframe>
                aXY = this.cfg.getProperty("xy");

                if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) {
                    this.syncPosition();
                    aXY = this.cfg.getProperty("xy");
                }
                Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]);
            }
        }
228000
def OnExportPDF(self, event):
        """"""

        wildcards = get_filetypes2wildcards(["pdf"]).values()

        if not wildcards:
            return

        wildcard = "|".join(wildcards)

        # Get filepath from user
        message = _("Choose file path for PDF export.")

        style = wx.SAVE
        filepath, filterindex = \
            self.interfaces.get_filepath_findex_from_user(wildcard, message,
                                                          style)

        if filepath is None:
            return

        self.main_window.actions.export_cairo(filepath, "pdf")

        event.Skip()
1316728
def to_xdr_object(self):
        """"""
        return Xdr.types.Memo(type=Xdr.const.MEMO_TEXT, text=self.text)
494472
function _xdr(url) {
        return new Promise(function(resolve, reject) {
            var req = new XMLHttpRequest();
            req.open('get', url);
            req.onerror = reject;
            req.onreadystatechange = function onreadystatechange() {
                if (req.readyState === 4) {
                    if ((req.status >= 200 && req.status < 300) ||
                        (url.substr(0, 7) === 'file://' && req.responseText)) {
                        resolve(req.responseText);
                    } else {
                        reject(new Error('HTTP status: ' + req.status + ' retrieving ' + url));
                    }
                }
            };
            req.send();
        });

    }
1076405
function iframeBoilerScript() {

	// Called from parent-window:
	window.__run__ = function(methodName, args, cb, deferred) {

		var isDeferred = false;

		window.deferred = function() {
			isDeferred = true;
			return deferred;
		};

		function callback() {
			return cb.apply(this, arguments);
		}

		// Define fallback transfer() method:
		callback.transfer = function() {
			// Remove [transfers] list (last argument)
			return cb.apply(this, [].slice.call(arguments, 0, arguments.length - 1));
		};

		if (cb) {
			args.push(callback);
		}

		var result = window[methodName].apply(window, args);

		window.deferred = function() {
			throw new Error('Operative: deferred() called at odd time');
		};


		if (!isDeferred && result !== void 0) {
			callback(result);
		}
	};
}
149597
function getCORSRequest() {
  var xhr = new root.XMLHttpRequest();
  if ('withCredentials' in xhr) {
    return xhr;
  } else if (!!root.XDomainRequest) {
    return new XDomainRequest();
  } else {
    throw new Error('CORS is not supported by your browser');
  }
}
231857
def get_contents(self, el, no_iframe=False):
        """"""
        if not no_iframe or not self.is_iframe(el):
            for content in el.contents:
                yield content
1034767
function(url){
                ajaGo._xhr.call(this, url, function processRes(res){
                    if(data.into && data.into.length){
                        [].forEach.call(data.into, function(elt){
                            elt.innerHTML = res;
                        });
                    }
                    return res;
                });
            }
930632
function xhrClient (request) {
    return new PromiseObj(function (resolve) {

        var xhr = new XMLHttpRequest(), handler = function (event) {

                var response = request.respondWith(
                'response' in xhr ? xhr.response : xhr.responseText, {
                    status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug
                    statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText)
                });

                each(trim(xhr.getAllResponseHeaders()).split('\n'), function (row) {
                    response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1));
                });

                resolve(response);
            };

        request.abort = function () { return xhr.abort(); };

        xhr.open(request.method, request.getUrl(), true);

        if (request.timeout) {
            xhr.timeout = request.timeout;
        }

        if (request.responseType && 'responseType' in xhr) {
            xhr.responseType = request.responseType;
        }

        if (request.withCredentials || request.credentials) {
            xhr.withCredentials = true;
        }

        if (!request.crossOrigin) {
            request.headers.set('X-Requested-With', 'XMLHttpRequest');
        }

        // deprecated use downloadProgress
        if (isFunction(request.progress) && request.method === 'GET') {
            xhr.addEventListener('progress', request.progress);
        }

        if (isFunction(request.downloadProgress)) {
            xhr.addEventListener('progress', request.downloadProgress);
        }

        // deprecated use uploadProgress
        if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
            xhr.upload.addEventListener('progress', request.progress);
        }

        if (isFunction(request.uploadProgress) && xhr.upload) {
            xhr.upload.addEventListener('progress', request.uploadProgress);
        }

        request.headers.forEach(function (value, name) {
            xhr.setRequestHeader(name, value);
        });

        xhr.onload = handler;
        xhr.onabort = handler;
        xhr.onerror = handler;
        xhr.ontimeout = handler;
        xhr.send(request.getBody());
    });
}
675117
function XHRProxy(options) { // @arg Object = {} - { verbose }
                             // @options.verbose Boolean = false
//{@dev
    $valid($type(options, "Object|omit"), XHRProxy, "options");
//}@dev

    options = options || {};
    this._verbose = options["verbose"] || false;

//{@dev
    $valid($type(options.verbose, "Boolean|omit"), XHRProxy, "options.verbose");
//}@dev

    this._event = new WMEvent()["register"](ALLOW_XHR_EVENTS);
    this._xhr = null;
    this._lv = FUNCTION_LEVEL_0;

    if (global["XMLHttpRequest"]) { // _runOnBrowser
        this._lv = FUNCTION_LEVEL_1;
        this._xhr = new XMLHttpRequest();

        if ("onload"          in this._xhr &&
            "responseType"    in this._xhr &&
            "withCredentials" in this._xhr) {
            this._lv = FUNCTION_LEVEL_2;
        }
    } else { // _runOnNode -> simulate XMLHttpRequest Object
        this._xhr = {
            "readyState":       READY_STATE_UNSENT,
            // --- request ---
            "method":           "",     // "GET" or "POST"
            "url":              "",
            "async":            true,
            "auth":             "",     // "" or "user:password"
            "requestHeader":    {},     // { header: value, ... }
            // --- response ---
            "response":         null,
            "responseText":     "",
            "responseXML":      null,
            "responseHeaders":  {},     // { header: value, ... }
            "status":           0,
            "statusText":       "",
            "upload":           null,
            "withCredentials":  false
        };
    }

//{@dev
    if (this._verbose) {
        console.log("XMLHttpRequest Level is " + this._lv);
    }
//}@dev

    this._lastRequestURL = "";
    this._lastReadyState = READY_STATE_UNSENT;

    // setup property getter and setter.
    Object.defineProperties(this, {
        "readyState":     { "get": getReadyState                                },
        "response":       { "get": getResponse                                  },
        "responseText":   { "get": getResponseText                              },
        "responseType":   { "get": getResponseType,   "set": setResponseType    },
        "responseXML":    { "get": getResponseXML                               },
        "status":         { "get": getStatus                                    },
        "statusText":     { "get": getStatusText                                },
        "upload":         { "get": getUpload,         "set": setUpload          },
        "withCredentials":{ "get": getWithCredentials,"set": setWithCredentials }
    });
}
430742
function() {

		// XHR cannot access local files, always use ActiveX for that case
		if ( this.isLocal ) {
			return createActiveXHR();
		}

		// Support: IE 9-11
		// IE seems to error on cross-domain PATCH requests when ActiveX XHR
		// is used. In IE 9+ always use the native XHR.
		// Note: this condition won't catch Edge as it doesn't define
		// document.documentMode but it also doesn't support ActiveX so it won't
		// reach this code.
		if ( document.documentMode > 8 ) {
			return createStandardXHR();
		}

		// Support: IE<9
		// oldIE XHR does not support non-RFC2616 methods (#13240)
		// See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
		// and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
		// Although this check for six methods instead of eight
		// since IE also does not support "trace" and "connect"
		return /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
			createStandardXHR() || createActiveXHR();
	}
869593
@Nullable
  private XTextDocument getCurrentDocument(XComponentContext xContext) {
    try {
      XComponent curComp = OfficeTools.getCurrentComponent(xContext);
      if (curComp == null) {
        return null;
      }
      else return UnoRuntime.queryInterface(XTextDocument.class, curComp);
    } catch (Throwable t) {
      MessageHandler.printException(t);     // all Exceptions thrown by UnoRuntime.queryInterface are caught
      return null;           // Return null as method failed
    }
  }
726062
function _getLi(srcUrl, iframeSrc) {
  var innerUl = [];

  if (srcUrl) {
    innerUl.push(util.format(sourceTemplate, srcUrl));
  }

  if (iframeSrc) {
    innerUl.push(util.format(newTabTemplate, iframeSrc));
  }

  return innerUl.join('');
}
1035921
function iframeOpen(url, strWindowName, strWindowFeatures) {
    var iframe, iframeDoc, script, openArgs, newWin;

    iframe = document.createElement('iframe');
    iframe.style.display = 'none';
    document.body.appendChild(iframe);
    iframeDoc = iframe.contentDocument || iframe.contentWindow.document;

    openArgs = '"' + url + '"';
    if (strWindowName) {
      openArgs += ', "' + strWindowName + '"';
    }
    if (strWindowFeatures) {
      openArgs += ', "' + strWindowFeatures + '"';
    }

    script = iframeDoc.createElement('script');
    script.type = 'text/javascript';
    script.text = 'window.parent = null; window.top = null;' +
      'window.frameElement = null; var child = window.open(' + openArgs + ');' +
      'if (child) { child.opener = null }';
    iframeDoc.body.appendChild(script);
    newWin = iframe.contentWindow.child;

    document.body.removeChild(iframe);
    return newWin;
  }
1057388
function xhrJson(method, url, options) {
		if (options && typeof options.data !== 'undefined') {
			options.data = JSON.stringify(options.data);
		}
		return xhr.apply(null, Array.prototype.slice.call(arguments)).then(function(result) {
			return JSON.parse(result.response || null);
		});
	}
1283172
function xhrSimpleDataSerializer(data) {
  var uri = [];
  var key;
  for (key in data) {
    uri.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key]));
  }
  return uri.join('&');
}