mOxie XmlHttpRequest IE8 and IE9 DOM error - internet-explorer-8

I'm implementing file picking and upload with moxie FileInput and XmlHttpRequest polyfills. I'm only using the HTML5 and HTML4 runtimes.
In IE8 & 9 I get NOT_FOUND_ERROR from the html4 xhr runtime when trying to send the file picked from the FileInput.
simple example of code:
https://gist.github.com/derrickwilliams/7390bd8e33aec336c0f8
The error is throw after calling xhr.send(formData);
Any help is greatly appreciated.

Problem:
My app uses angular and ui-router. The view, where the FileInput is rendered, get destroyed after moving to the next state where the XHR request is actually made. It seems that is only a problem with html4 runtime.
Solution:
I used the container option to have the FileInput render outside of the element that is destroyed during state transition.

Related

Unable to write in input tag in Xamarin MacOs Webview within a iframe

We have a Xamarin MacOs App that uses a webview to display web content.
The first page showed is a local html page text. That page have a iframe that point to a external web that its allowed to be embed like vimeo.
If that iframe have a input of type "text" and try to write in it, no keypress/keydown is fired, and then no text is write inside of the input.
Have extended WebKit.WebView to have access to native properties, but haven't found any preference to allow this.
The version used of Xamarin Forms is 5.0.0.2196
Have any a workaround for this strange scenario ?
Tx
UPDATE 1
If press the keys "Control+tab", then input starts to receive input keys. So, the problem is that the control in iframe have focus, but the iframe in webview dont.
You need to detect any keyup events within the iframe. Here's the HTML & JS code snippets below for your reference:
HTML:
<iframe id='this-iframe'></iframe>
JS:
var iframe_content = '<html><body><input type="text" id="input_id"/><span id="result"></span></body></html>';
var doc = document.getElementById('this-iframe').contentWindow.document;
doc.open();
doc.write(iframe_content);
doc.close();
$(document.getElementById('this-iframe').contentWindow.document).keyup(function(e){
if($('#this-iframe').contents().find('#input_id').is(":focus")){
$('#this-iframe').contents().find("#result").html($('#this-iframe').contents().find('#input_id').val());
}
});

How does React deal with pre-compiled HTML from PhantomJS?

I compiled my reactjs using webpack and got a bundle file bundles.js. My bundles.js contains a component that make API calls to get the data.
I put this file in my html and pass the url to phantom.js to pre-compile static html for SEO reasons.
I am witnessing something strange here, the ajax calls for APIS are not getting fired at all.
For example, I have a component called Home which is called when I request for url /home. My Home component makes an ajax request to backend (django-rest) to get some data. Now when I call home page in phantomjs this api call is not getting fired.
Am I missing something here?
I have been using React based app rendering in Phantomjs since 2014. Make sure you use the latest Phantomjs version v2.x. The problems with Phantomjs occur because it uses older webkit engine, so if you have some CSS3 features used make sure they are prefixed correctly example flexbox layout.
From the JS side the PhantomJS does not support many newer APIs (example fetch etc.), to fix this add the polyfills and your fine. The most complicated thing is to track down errors, use the console.log and evaluate code inside the Phantomjs. There is also debugging mode which is actually quite difficult to use, but this could help you track down complex errors. I used webkit engine based browser Aurora to track down some of the issues.
For debugging the network traffic, try logging the requested and received events:
var page = require('webpage').create();
page.onResourceRequested = function(request) {
console.log('Request ' + JSON.stringify(request, undefined, 4));
};
page.onResourceReceived = function(response) {
console.log('Receive ' + JSON.stringify(response, undefined, 4));
};

IE8 issues with Yammer embed and API

Facing multiple issues with IE 8 (detailed version 8.0.7601.17514). Please note everything works fine in other browsers.
Yammer embed my feed control is not working. Sometimes it shows result and sometimes not.
REST API call not working and giving error as below. However I used new js sdk and new yam.platform.request.
Error is : yam.request is null or not an object. source : platform_js_sdk.js
Thanks in advance for your help!
I found out that the div that you embed yammer feed has to be above the yammer request script
eg.
<div id="embedded-feed" style="height:400px;width:500px;"></div>
<script>
yam.connect.embedFeed(
{ container: '#embedded-feed',
network: 'fourleaf.com' // network permalink (see below)
});
</script>
Otherwise, IE will not be able to find the div to show the feed (but chrome works fine..)

Clean up DOM after a Firefox add-on SDK extension Disable/Remove action is fired

I am working on a add-on SDK extension which uses a pageMod object with a content script that adds a DIV tag to the DOM (this tag behaves like a button) when the action button is being clicked.
I am trying to find a solution where I can delete that newly added DOM element when the extension is being disabled or removed and I've had no luck so far.
The first thing that I've tried was to use the AddonManager.addAddonListener(listener) approach where I would listen for a onUninstalling or a onDisabling event and then communicate with the content script but I got nowhere.
What I've tried next was to make use of the exports.onUnload solution where I tried to send a message from the pageMod's worker to the content script and deal with the removal of the DIV from there but it seems that the content script is no longer responsive by the time the onUnload function is being triggered.
Is there really no way to clean up the modified DOM when the extension is being disabled/removed?
At your content script listen for the detach event.
self.on("detach", function(reason){
//remove that div
});
In #paa's answer the "port" part is missing:
e.g., from the docs
var oldInnerHTML = window.document.body.innerHTML;
window.document.body.innerHTML = "eaten!";
self.port.on("detach", function() {
window.document.body.innerHTML = oldInnerHTML;
});
I am not using PageMod nd this works for me.

Internet Explorer Error

The main error shown in IE is : ' Could not complete the operation due to error 80020101.'
The error is displayed when the ExtJS framework tries to load a page containing a Ext grid component through an ajax request.
It works without problems in Firefox and Chrome.
Another error which is shown by IE is 'Expected identifier, string or number' which points to the line containing HTML inline style definition which is perfectly valid. I am not sure why this error is shown. I feel IE is pointing this error to the wrong place.
Could anyone please help me out on this?
"Could not complete the operation" errors in IE are usually caused by trying to modify the DOM before it is ready.
Move the JS so it fires in (for example) the onload event, or a JS library's ondomready event.
If you are loading a page using ajax and it has a inline script file like below add // before
the open comment tag
<script type="text/javascript">
// <!--
alert('text');
// -->
</script>
http://dracoblue.net/dev/could-not-complete-the-operation-due-to-error-80020101/137/

Resources