GithubHelp home page GithubHelp logo

Comments (12)

janpio avatar janpio commented on July 20, 2024

For the example:
Which file would you load in your IAB instance and then get a blank page? Which ones would work?

Can you load the page in your normal native browser?

Which platform?

from cordova-plugin-inappbrowser.

skrawn avatar skrawn commented on July 20, 2024

If I tell IAB to load Default.htm, the page is blank. I'm not totally familiar with what MadCap does with their scripts, but when you open Default.htm in a normal browser, the JS in the head loads and it goes to the Home.htm page. When you direct the IAB to load Home.htm, it goes to home page but none of the dynamic elements in the page or links to other pages are working.

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on July 20, 2024

I am not sure if you will get anything from IAB, but did you try to remote debug the problem and see if it can't load some URLs or there is some output in the console? https://ionic.zone/debug/remote-debug-your-app

from cordova-plugin-inappbrowser.

skrawn avatar skrawn commented on July 20, 2024

I know it can load external URLs like I can open wikipedia or apache.org in the IAB and they seem to work fine. Debugging is tricky though. When I run on an Android device, I can use Chrome to inspect the app as it is running, but since I launch the IAB with the _blank target, it opens in a new window and I can't use the Chrome performance tools to see what happens when the IAB initially opens. When I run my app as a Windows app, I run into a similar problem where the IAB opens but there is no way to inspect the content in the IAB from within the debugger (Visual Studio) nor anyway to see what, if any, output is being generated by IAB.

It may also be worth nothing that some things work differently depending on the target. For example, as a Windows app, the _system target does not work for me (likely due to an IT policy), the _blank target lets the hamburger menu open but there is nothing in it, and the _self target doesn't let the hamburger menu open at all.

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on July 20, 2024

What host are you loading the URL from? local or remote?

from cordova-plugin-inappbrowser.

skrawn avatar skrawn commented on July 20, 2024

It's a local URL. I have the files at www/assets/.

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on July 20, 2024

When I load the Default.htm from the example project I am redirected to ´Content/Home.htm` - which is a pretty standard website.

What you describe sounds a bit like a problem with loading data based on a relative path or something. The "base" in the IAB might be different than when loading the file manually in the browser or something - I would try to understand that.

One way: Find out how the files that seems to be missing are loaded, add links to the same URLs to the homepage and click them. Can the file be loaded?

from cordova-plugin-inappbrowser.

skrawn avatar skrawn commented on July 20, 2024

Interesting...would you mind sharing your Cordova project?

from cordova-plugin-inappbrowser.

janpio avatar janpio commented on July 20, 2024

Sorry, I didn't create a Cordova project but downloaded the sample project you linked and tested in normal browser to understand what you meant.

from cordova-plugin-inappbrowser.

skrawn avatar skrawn commented on July 20, 2024

Alright, so I tried just placing a link to the home page from default and it was unable to navigate to the page. The path looks correct though:

Android Debug

I also made a bare bones example program: https://github.com/skrawn/MadCapTest This should be build-able in Visual Studio and on the command line.

from cordova-plugin-inappbrowser.

bbending626 avatar bbending626 commented on July 20, 2024

Hello skrawn
I am working on integrating MadCap flare help into an ionic-cordova project for both Android and Windows. I have the same issues.

Do you have a resolution?

Here is what I found so far:
Android:
target=_blank
url=help/Default.htm
Default.htm does not work, shows a bank page. The page doesn't redirect to Contents/Home.htm. If you open Contents/Home.htm directly then the help page is displayed but menu from hamburger menu don't navigate. This is some path issue, but I have not found the solution yet.
I am able to get the help page to display and navigate using iframe in a webview. It's a solution but I would like to use inappbrowser for both platforms.

Windows:
target=_blank
url=help/Default.htm
Default.htm and Contents/Home.htm open the help page and hamburger menu links work. The issue is in MadCap flare. You will need to unminify MadCapAll.js to make the mods. If you have MadCap software your modifying Xhr.prototype.Load function in MadCapXhr.js to evaluate document.location.prototype values equal to ms-appx: and ms-appx- web:.
prototype == 'ms-appx:' || prototype == 'ms- appx-web:'

Hope this helps.

from cordova-plugin-inappbrowser.

bbending626 avatar bbending626 commented on July 20, 2024

from cordova-plugin-inappbrowser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.