Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executeSQL arguments from iFrame are always empty #813

Open
BrunoTMartins opened this issue Aug 24, 2018 · 2 comments
Open

executeSQL arguments from iFrame are always empty #813

BrunoTMartins opened this issue Aug 24, 2018 · 2 comments

Comments

@BrunoTMartins
Copy link

When using an iFrame, all the arguments in executeSQL are never sent.

I found that in SQLitePlugin.js the following validation was returning FALSE:

line 363: values.constructor === Array

This seems due to the fact that Array objects created within one iframe do not share [[Prototype]]’s with arrays created within another iframe.

As a solution i think this could be used instead:

Array.isArray(values)

@pniotout
Copy link

pniotout commented Oct 30, 2018

👍
I found the same problem and the same solution with a gwt project.
I have also modified :

line 268 : if (!sqlStatements || sqlStatements.constructor !== Array) {
to
if (!sqlStatements || !Array.isArray(sqlStatements)) {
and
line 275: if (st.constructor === Array) {
to
if (Array.isArray(st)) {

@brodycj
Copy link
Contributor

brodycj commented Oct 30, 2018

Thanks for reporting. I hope to fix this in the next major release in December 2018 ref: #773

ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants