You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/07/01 00:00:07 UTC

[GitHub] [cordova-plugin-file] phatpaul commented on issue #316: Do not overwrite standard File API

phatpaul commented on issue #316:
URL: https://github.com/apache/cordova-plugin-file/issues/316#issuecomment-1171781698

   @chr15m This is the way.  Thanks for the hint.
   
   FYI what I did in my index.html:
   ```html
     <script>
       window.File_native = window.File; // backup the native File api because cordova-plugin-file clobbers it.
     </script>
     <script type="text/javascript" src="cordova.js"></script>
   ...
   ```
   
   And when I needed to use the native File API in js:
   ```js
                           let File = window.File;
                           if ("File_native" in window) { // cordova-plugin-file clobbers File(), so we backed it up at the beginning of index.html before loading cordova.js
                               // @ts-ignore
                               File = window["File_native"];
                           }
                           let otaBinary = new File([theBlob], fname);
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org