artoo icon indicating copy to clipboard operation
artoo copied to clipboard

Firefox save doesn't work

Open addadi opened this issue 9 years ago • 7 comments

.-""-.
Example console output: /[] _ \
|o_LII| / | ==== |
|
| ==== |
| ||LI o || ||'----'|| artoo.js /| |\ v0.3.2 artoo-latest.min.js:2:19592 [artoo]: - jQuery already exists in this page (v2.1.1). No need to load it again. artoo-latest.min.js:2:19291 [artoo]: - artoo is now good to go! artoo-latest.min.js:2:19291 artoo.savePrettyJson({k:'v'}) undefined

using firefox 41.0.2. same behaviour with all other save method

addadi avatar Oct 27 '15 10:10 addadi

Hello @addadi. Will test this asap to check where things went bad.

Yomguithereal avatar Oct 27 '15 17:10 Yomguithereal

thanks a lot :) I found a workaround with the console.save snippet from here: http://bgrins.github.io/devtools-snippets/ so it's not that urgent. perhaps the code there can help you finding a solution for cross browser savings. Anyway thanks for the great library!

addadi avatar Oct 28 '15 07:10 addadi

The thing which is strange is that I basically use the same method as the one displayed in your snippet. Do you have an error shown in the console when trying to use the lib's save methods?

Yomguithereal avatar Oct 28 '15 09:10 Yomguithereal

nope. i tried on two machines (linux and windows) + with all addons disabled

addadi avatar Oct 28 '15 13:10 addadi

artoo.savePrettyJson() does not work for me neither (firefox, ubuntu)

swergas avatar Nov 13 '15 18:11 swergas

I'm having the same issue on Firefox 42.0, OS X Yosemite 10.10.5.

After a quick research + testing, seems like Firefox doesn't simulate the click if the element is not attached to the DOM.

A quick & dirty solution would be to attach the element, trigger the click, and remove the element afterwards.

If you are ok with this I can provide a pull request :).

cc @Yomguithereal

roperzh avatar Nov 18 '15 13:11 roperzh

@roperzh, this seems like a sensible solution. However I don't get why the snippet shown by @addadi works then since the element is not attached to the DOM either.

Yomguithereal avatar Nov 18 '15 14:11 Yomguithereal