[jira] [Commented] (CB-10858) Cant access javascript native File function
[ https://issues.apache.org/jira/browse/CB-10858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15648210#comment-15648210 ] Sam Kelleher commented on CB-10858: --- ``` window.cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'File') ``` However, this workaround doesn't work as it still returns the overwritten File object which is not WebAPI compliant. This issue needs re-opening, or resolving in duplicate https://issues.apache.org/jira/browse/CB-11720 //cc [~vladimir.kotikov] > Cant access javascript native File function > --- > > Key: CB-10858 > URL: https://issues.apache.org/jira/browse/CB-10858 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File >Reporter: jose nuno neto >Priority: Trivial > Labels: question, triaged > > I am using the cordova-plugin-file and need to create a File object with > javascript native function > https://developer.mozilla.org/en/docs/Web/API/File > But this plugin overrides that defenition. > How can I use the plugin and still have acess to the native File function? -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-10858) Cant access javascript native File function
[ https://issues.apache.org/jira/browse/CB-10858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15424365#comment-15424365 ] Vladimir Kotikov commented on CB-10858: --- [~jnccneto], you can also use {{cordova/modulemapper}} to get access to original {{File}} constructor. The example is here: https://github.com/apache/cordova-plugin-inappbrowser/blob/master/www/inappbrowser.js#L90 > Cant access javascript native File function > --- > > Key: CB-10858 > URL: https://issues.apache.org/jira/browse/CB-10858 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File >Reporter: jose nuno neto >Priority: Trivial > Labels: question, triaged > > I am using the cordova-plugin-file and need to create a File object with > javascript native function > https://developer.mozilla.org/en/docs/Web/API/File > But this plugin overrides that defenition. > How can I use the plugin and still have acess to the native File function? -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-10858) Cant access javascript native File function
[ https://issues.apache.org/jira/browse/CB-10858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15416932#comment-15416932 ] jose nuno neto commented on CB-10858: - It's mistake in code design, they should just change the name of the function on the code. Simple. Not sure how you change the status, but go ahead > Cant access javascript native File function > --- > > Key: CB-10858 > URL: https://issues.apache.org/jira/browse/CB-10858 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File >Reporter: jose nuno neto >Priority: Trivial > Labels: question, triaged > > I am using the cordova-plugin-file and need to create a File object with > javascript native function > https://developer.mozilla.org/en/docs/Web/API/File > But this plugin overrides that defenition. > How can I use the plugin and still have acess to the native File function? -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-10858) Cant access javascript native File function
[ https://issues.apache.org/jira/browse/CB-10858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15414774#comment-15414774 ] László Radics commented on CB-10858: Basically its not a question but a major bug. Should I resubmit without question? Plugin change the browser API ! > Cant access javascript native File function > --- > > Key: CB-10858 > URL: https://issues.apache.org/jira/browse/CB-10858 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File >Reporter: jose nuno neto >Priority: Trivial > Labels: question, triaged > > I am using the cordova-plugin-file and need to create a File object with > javascript native function > https://developer.mozilla.org/en/docs/Web/API/File > But this plugin overrides that defenition. > How can I use the plugin and still have acess to the native File function? -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-10858) Cant access javascript native File function
[ https://issues.apache.org/jira/browse/CB-10858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15315751#comment-15315751 ] László Radics commented on CB-10858: here is a workaround //workaround: https://issues.apache.org/jira/browse/CB-10858 //native API: File([blob], name, properties) //cordova API: File(name, localURL, type, lastModifiedDate, size) function fixFile() { document.addEventListener("deviceready", function () { var cordovaFile = window.File; delete window.File; var nativeFile = window.File; window.File = function () { var arg = []; // unshift for (var i = arguments.length; i > 0; i--) arg[i] = arguments[i - 1]; if (Array.isArray(arguments[0])) { return new (Function.prototype.bind.apply(nativeFile, arg)); } else { return new (Function.prototype.bind.apply(cordovaFile, arg)); } }; }); } > Cant access javascript native File function > --- > > Key: CB-10858 > URL: https://issues.apache.org/jira/browse/CB-10858 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File >Reporter: jose nuno neto > Labels: triaged > > I am using the cordova-plugin-file and need to create a File object with > javascript native function > https://developer.mozilla.org/en/docs/Web/API/File > But this plugin overrides that defenition. > How can I use the plugin and still have acess to the native File function? -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-10858) Cant access javascript native File function
[ https://issues.apache.org/jira/browse/CB-10858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15315724#comment-15315724 ] László Radics commented on CB-10858: Its absolute a major priority, nobody should override web APIs with incompatible interface. > Cant access javascript native File function > --- > > Key: CB-10858 > URL: https://issues.apache.org/jira/browse/CB-10858 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File >Reporter: jose nuno neto > Labels: triaged > > I am using the cordova-plugin-file and need to create a File object with > javascript native function > https://developer.mozilla.org/en/docs/Web/API/File > But this plugin overrides that defenition. > How can I use the plugin and still have acess to the native File function? -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-10858) Cant access javascript native File function
[ https://issues.apache.org/jira/browse/CB-10858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15195165#comment-15195165 ] jose nuno neto commented on CB-10858: - I am using another variable to link to the original File function. I create the variable before cordova starts. It's a workaround, but you shouldn't use common function names in plugins > Cant access javascript native File function > --- > > Key: CB-10858 > URL: https://issues.apache.org/jira/browse/CB-10858 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File >Reporter: jose nuno neto > Labels: triaged > > I am using the cordova-plugin-file and need to create a File object with > javascript native function > https://developer.mozilla.org/en/docs/Web/API/File > But this plugin overrides that defenition. > How can I use the plugin and still have acess to the native File function? -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org