Webrow opened a new issue #628: beforeload not firing when opening .pdf files URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/628 # Bug Report ## Problem beforeload events do not fire unless a webpage is loaded. Its not working for example with .pdf files ### What is expected to happen? beforeload to fire before downloading a .pdf ### What does actually happen? beforeload does not fire ## Information <!-- Include all relevant information that might help understand and reproduce the problem --> ### Command or Code <!-- What command or code is needed to reproduce the problem? --> ``` // Add beforeload event handler which is called before each new URL is loaded into the InAppBrowser Webview browser.addEventListener("beforeload", function(params, callback) { console.log("Firing before load") // If the URL being loaded is a PDF if (params.url.match(".pdf")) { console.log("I am matching pdf ") // Open PDFs in system browser (instead of InAppBrowser) cordova.InAppBrowser.open(params.url, "_system"); console.log("shouldve opened a proper browser now") } else { // Invoke callback to load this URL in InAppBrowser callback(params.url); } }); ``` ### Environment, Platform, Device <!-- In what environment, on what platform or on which device are you experiencing the issue? --> Iphone 11 pro max, 13.3 simulator ### Version information <!-- What are relevant versions you are using? For example: Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins Other Frameworks: Ionic Framework and CLI version Operating System, Android Studio, Xcode etc. --> cordova cli 9.0 ionic v1 cordova iap 3.2.0 ## Checklist <!-- Please check the boxes by putting an x in the [ ] like so: [x] --> - [x] I searched for existing GitHub issues - [ ] I updated all Cordova tooling to most recent version - [x] I included all the necessary information above
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
