docwhat / itsalltext

It's All Text! - Edit textareas in your browser with your favorite editor!
GNU General Public License v3.0
197 stars 31 forks source link

Upgraded Firefox to 25.0.1, javascript error upon saving. #55

Closed skyl closed 9 years ago

skyl commented 10 years ago

In this very textarea on github, I hit save with my editor (MacVim).

The yellow background flashes. The content of the textarea updates.

In the console,

Error: Permission denied to access property 'type' @ https://github.global.ssl.fastly.net/assets/frameworks-bca527bb59d94c16d6bf2a759779d7953fa41e76.js:2

On a site I'm working on, I get a similar error:

Error: Permission denied to access property 'type' @ /static/admin/js/jquery.js:2749

There, I'm listening for the change event on the textarea. The change event no longer gets fired when I save from my editor.

I did not have this problem before upgrading FF today.

docwhat commented 10 years ago

Hello!

The yellow background flashes.

Do you mean the normal fade from yellow? Or it happens quickly?

I'm not sure how IAT can create those errors in external JavaScript libraries.... Have you tried disabling IAT and seeing if the errors still happen?

The change event no longer gets fired when I save from my editor.

Interesting. That might be related to something similar to this stack overflow

I'll take a look at it when I have time. At the moment, I'm dealing with a death in the family. No promises when I'll get to it.

Patches are welcome!

xOneca commented 10 years ago

Hello! I'm new to GitHub, so I put a patch for this issue here as a quick fix:

--- cacheobj.js.orig    2014-01-10 14:22:11.000000000 +0100
+++ cacheobj.js 2014-01-10 14:23:58.000000000 +0100
@@ -579,7 +579,7 @@
             this.fade(20, 100);
             this.node.value = value;

-            var event = document.createEvent("HTMLEvents");
+            var event = this.node.ownerDocument.createEvent("HTMLEvents");
             event.initEvent('change', true, false);
             this.node.dispatchEvent(event);

(diff against https://github.com/docwhat/itsalltext/commit/8516c261dbe4227acc4addd606bba10c9e6b32cf)

Cheers!