I have an Android application that has a WebView in it, it opens an external website that is supposed to be populated by my application. There is no issue populating it using javascript
(document.getElementById('id').value='something')
if it's an ordinary website.
However, the site that I am having trouble with is done in Flutter so it is making use of Dart.js. The form elements are not accessible and will always return null with any selector.
I have tried document.getElementsByTagName, document.querySelector and document.evaluate for xpath but the result is the same.
The goal of the application is to autofill the site with its profile data.
EDIT: I've done some reading and found out that it makes use of Shadow DOM which I am not familiar to, I was able to pull the value but it doesn't accept any changes
(document.firstChild.nextSibling.childNodes[2].childNodes[10].shadowRoot.childNodes[5].value)
Related
I'm working on a URL preview widget, so I'd like to extract the meta tags from the HTML of a given URL.
However, the problem is that websites like Twitter don't return the entire HTML when they detect there's no JavaScript engine enabled (i.e. doing a GET request from the http package).
So, I'd like to know if there's any workaround for these cases, for example, using some kind of headless browser to get the entire HTML.
Thanks!
I am trying to make custom app using the Moodle API.
How can I display and return courses of type lesson?
In my lesson, there is a choice type questions in between the lesson pages. The Moodle API (mod_lesson_get_page_data) returns the page content on two object properties viz, lesson_page_data->page->contents and lesson_page_data->pagecontent. The later contains HTML with buttons to submit the question, but when I click, the form is directed to the Moodle site and is asking to login. Instead I am looking for a solution to solve it in mobile itself without redirecting to site.
There are currently no (and probably never will be) methods to return whole offline lesson. You should use scorm for that task. However, why don't you replace all links in html with your own and write a small script that simply gets all parameters, creates and executes curl request and returns html?
Is there a way to unload filepicker from a webpage?
I'm building an app using Meteor. I want to give only logged in users to have access to filepicker. Each use gets his own unique key. I want to destroy all references to filepicker once the user logs out.
Apart from the JS and the initialized filepicker object, I noticed there is an iframe being introduced by filepicker. Are there any more artifacts being loaded into browser as part of filepicker? Is there a safe way to unload all the filepicker specific elements from the page?
The iframe is used for cross-domain communication, and will not leak any information, etc. if it remains in. However, if you want to remove all elements introduced by Filepicker.io, then yes deleting the script tag and the filepicker js object, along with the filepicker_comm_iframe should do the trick
I have a GWT app and Im trying to put fb social plugin comment in side of my page. However I have the folowing problem.
If I put the tag in my .html it works perfect, but If I put id dynamically (like with an HTML widjet), It does not work. It just does not display anything.
Can anyone help me? Im having this problem in general, not only with the fb:comment tag.
Note: If I use the iframe implementation of, for example, "fb:like", it works perfect.
My understanding of facebook's api is that it loads your content, and parses out the tags in the fb namespace, replacing them before the actual content is drawn for the user. In contrast, none of the GWT compiled code (or indeed any Javascript code) gets a chance to make changes to the dom until the page has loaded in the browser fully, after facebook has made the changes it needs to.
My advice: Put the fb namespaced tags on the initial page, but perhaps wrap them in a div and mark them as display:none. Then you can grab them from your GWT code and wrap them up in a widget, only to be displayed when you are ready.
in titanium, i'm using the webview to display a wordpress blog page, that is already formatted for mobile browser. instead of writing my own interface, this works as a good work around. the apps sole focus isn't the browser.
but my issue lies, when the user clicks a link outside of the initial displayed domain. i only want the main domain to be displayed in the apps browser. if any other link is clicked, that takes the user outside of that domain, i want to have it open in the phones default browser.
can anyone point me in a direction for this. i tried adding a listener to try and catch link clicks, however, i've been unsuccessful.
thanks
in this blog posting I show how to find links in a webpage and change the link behavior. Using the same method, you can intercept the links and redirect to opening the URL in the devices default browser
One solution would be to catch the onclick() Event by Javascript inside the WebView (your blog code) and handle this by a custom handler. Maybe you can inject the javascript event handler code into the running WebView through Titanium.
Another solution is to make your blogposts readable for app technology and create a new data interface. This is the way I would do. For that I would use some kind of JSON data format and a simple REST Interface to get the data.
I don't think bove solutions are that simple. If you want an app with "great feeling", you'll have to handle the events by your own. Maybe Phonegap would be a better solution four your problem. But there you will still need a kind of REST/JSON interface for your blog data. The idea behind an app is, that the main code is in your app and you get the content from a remote source. This way you'll get an advantage compared to a simple browser optimized site.