Note that there are some explanatory texts on larger screens.

plurals
  1. POChrome extension disappears when Developer tools are closed
    primarykey
    data
    text
    <p>I am making a simple Chrome extension with a file upload form. It works fine when Developer tool window is open for the addon ("insepect element"), but when I try to run it without developer tools, the addon collapses when I click on the file selection button. What's wrong? I am using Chrome version 22 on OSX 10.7.5</p> <p>The code is the following:</p> <p>Here is the HTML part:</p> <pre><code>&lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="upload.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form enctype="multipart/form-data" method="post" action="http://localhost" id="form"&gt; &lt;input type="file" id="file" name="file" &gt; &lt;input type="button" id="sub" value="Upload"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And here is the upload.js</p> <pre><code>function upload(form) { var formData = new FormData(form); var req = new XMLHttpRequest(); req.open("POST", form.getAttribute("action")); req.onload = function(event) { console.log(event.target.responseText); }; req.send(formData); } document.addEventListener( "DOMContentLoaded", function(){ document.getElementById("sub").addEventListener("click", function() { upload(document.getElementById("form")); }, false); }, false ); </code></pre> <p>And here is the manifest.json:</p> <pre><code>{ "name": "Issue-img", "version": "1.0", "manifest_version": 2, "description": "Simple upload.", "browser_action": { "default_icon": "icon.png", "default_popup": "upload.html" }, "permissions": [ "http://localhost/" ] } </code></pre> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload