Possible to extract a part of code HTML of WebView and exposes to QML?

Spending a few hours to research this, but not really sure.

My application has a lyrics Viewer, it opens the page with a WebView then uses evaluateJavaScript to strip all normal visible header and the actual words, everything works great and leaves me with just the text words.

I would like to take that text and somehow move it to QML so I can strip things html and ending up with a gross QString with the text of the words and finally display it with a tag, but not really sure how.

     webView.evaluateJavaScript(
                         "var content = document.getElementById('mw-content-text');" +
                         "while (document.head.firstChild) { document.head.removeChild(document.head.firstChild); }" +
                         "while (document.body.firstChild) { document.body.removeChild(document.body.firstChild); }" +
                         "var header = document.createElement('h1');" +
                         "header.style.color = ('white');"+
                         "header.innerHTML = '" +  lyricsDataArtist+ " " +  lyricsDataSong + " Lyrics';" +
                         "document.body.appendChild(header);" +
                         "var lyrics = content.getElementsByClassName('lyricbox')[0];" +
                         "lyrics.removeChild(lyrics.firstChild);" +
                         "document.body.appendChild(lyrics);"+
                         "lyrics.style.color = ('white');"+
                         "document.body.style.background = ('black');"
                         );

Any ideas appriciated.

Thank you

I suspect you can do what you need by calling navigator.cascades.postMessage () of your injected JavaScript and catch with the WebView::messageReceived signal. I use this mechanism in my application support to get stuff to the pages loaded in my C++ code, but it also works well with QML.

Signal WebView::messageReceived() documentation

Tags: BlackBerry Developers

Similar Questions

  • Security for the COD file question: is it possible to extract the BlackBerry devices .cod file?

    Is it possible to extract the BlackBerry devices .cod file?

    We want to ship the BlackBerry device with our application installed.

    I was wondering if need to add additional security.

    Installing drivers USB BlackBerry Desktop Manager, connect the BlackBerry to the PC via USB/Bluetooth and «save the JavaLoader.exe u your_module_here»

    PS JavaLoader.exe comes with the BlackBerry development Java (JDE) environment.

  • I can switch between the code sheet and css html, but I would like to see them both at the same time as well as the design window. Right now and can see rather the design and code html or design and css. How can I arrange to see all at the same time, of

    Hello

    My name is Ellie and I am new to Dreamweaver.

    I can switch between the code sheet and css html, but I would like to see them both at the same time as well as the design window. Right now and can see rather the design and code html or design and css. How can I arrange to see everything at the same time, design, HTML and CSS?

    Thank you

    It ends up something like that...

  • How can I extract a part of a signal inside a loop control and simulation?

    I would like to extract the part of my signal between 0 and 3 seconds. I tried to use the extract of Portion of Signal VI Express, but it does not work. I'm setting the length to the offset 0 and 3 seconds. However, nothing is displayed in the output. I used this before VI successfully, but it wasn't in a loop control and simulation. Is there something special I need to do to make this work properly in this case?

    This forum shows how to measure the time between the Digital pulse http://forums.ni.com/t5/LabVIEW/Measuring-time-between-digital-pulses/td-p/1056881

    In addition, it would be a good link https://decibel.ni.com/content/docs/DOC-12160

  • Is it possible to create with Adobe Muse mail HTML Templates?

    Is it possible to create with Adobe Muse mail HTML Templates? or to convert only the html content of the page createt? other tools such as a website copyer?

    tanks for help!

    On the top of my head, you should be able to create models of mail to the muse, BUT he will know very basic html/css on your part. I guess you have just signed?

    Create the design you want on a single page, don't do any kind of style in a master page. Then export the site in a folder. Open the file html with notepad / textedit and then copy just the code for the model. Throw in you choice mail app and it should work.

    This looks like something we could do much more quickly in dreamweaver in design mode.

    Please NOTE: ^ I'm wrong completely - but in theory this may work.

  • Downloading app: several files were COD files were extracted single file of COD.

    Hello

    Right now I'm in the process of downloading my first request on the BB App world. In step 6, after you download COD I have following message

    Your upload from a zip file has completed, see the files in your package. 5 COD files have been extracted.

    Five Code files! Is there something wrong? How is it possible to have FIVE COD files that I downloaded a?

    concerning

    Mukesh

    Hello

    Generated by the JDE COD files can be extracted with WINRAR. I did and found 5 different files of COD suffixed as "-1.cod" to "-4.cod". This is how to get the list

    . COD

    -1.cod

    -2.cod

    -3.cod

    -4.cod

    I extract the first file and loaded on the device. He gave me a few missing module error. And their module is - 1.cod. If all of the .cod files are interrelated and represents the different module. But I do not know which file represents the module in which and how the module is created during execution.

    ANY OTHER COMMENT ON IT IS MORE THAN WELCOME!

    concerning

    Mukesh

  • extract a part of a picture to manipulate

    I tried to extract a part of a picture so that I can work on only a part of it.

    First of all, I import an image and use the tools KING to get the global rectangle.  Then I try to use the global rectangle to extract the part of the image that I want to work on.  That seems to work, except when I move the Courvite back on the original image, the original image "becomes" the extracted image... I tried to copy the original image before working, but the same thing seems to happen... any thoughts.

    This is because you have connected your destination "img" imaq extract.vi to a new imaq create. Create one, give it a different name. It will work.

  • Can someone tell me how to extract a part of a digital waveform?

    I am trying to extract a part of 2 analog waves (using the http://zone.ni.com/devzone/cda/epd/p/id/4149 for example) analog signals is synchronized with a digital waveform.  I need to extract the same portion of a digital waveform.  Can someone tell me how to add the digital extractor in the example above?

    Hello

    Here's your extractor example slightly modified in order to add the digital data extraction.

    The principle is exactly the same, the tricky part is how to get digital data which is different from analog data.

    You can also add nodes property to identify the value read on the analog graph sliders on the digital chart.

    Kind regards

  • Is it possible to extract personal folders from my hard drive and transfer to an external hard drive if Windows does not start?

    Hello, I recently started my Windows XP Dell computer and it should start up normally unless it would run the ChkDsk utility. It would freeze then 68% on stage 1 and goes no further. I called the people of Dell and after trying so many solutions, including safe mode, safe mode with network and CommandPrompt, we ran the diagnosis. The hard drive and memory are fine, no errors. He concluded that it was the operating system and must be restored. However, I have important files, I need to extract from my hard drive and he recommended me an external hard drive. I bought it, but now I'm not sure how to extract my files from my drive hard if Windows can not even boot the desktop computer. Is it possible to extract these files without the use of the desktop computer?

    And you've burned the .iso image, and not as data? If Yes, then you have created a bootable CD. Put it in your optical drive and restart the computer. You may need to change the boot order in your BIOS. With some machines, you can get a temporary startup command menu by pressing a function such as F12 at startup. Other computers require that you enter setup and change the boot order in the optical drive first of all from there. When you start your computer it will be information about which key press to enter the BIOS (Setup) or give you the temporary boot order.

    After you changed the boot order to boot first from the CD and rebooted the computer, Knoppix will boot. Have your external hard drive connected to the computer before you start doing this. After Knoppix is finished booting, you will be in his office. It will be very similar to Windows. There are icons on the desktop for your internal hard drive and the external hard drive. Copy files from the internal to the external drive as you want. Review what I wrote about the use of Knoppix in my previous answer. MS - MVP - Elephant Boy computers - don't panic!

  • I accidentally deleted a file from my USB. is it possible to extract the file?

    original title: the files on USB.

    I accidentally deleted a file from my USB. is it possible to extract the file?

    Try using one of the many recovery tools. R-Studio is good, but the ins' free t. Microsoft Student Partner

  • Windows cannot install required files. File is possibly corrupted or missing. Error code 0 x 80070570

    I have Windows 7 Professional upgrade disk. I select custom installation. the trial ends approximately 54% then displays this message: Windows cannot install required files. File is possibly corrupted or missing. Error code 0 x 80070570 do - what I do?

    try to install by removing a strip of memory (RAM) If you have 2 stick of ram installed.

  • Possible to extract data from a 3D PDF 3D?

    I just want to check for security reasons, if it is possible to extract a 3D PDF 3D data.

    We told me be external companies, it is NOT possible, but want no biased entry of real Adobe employees and other experts.

    Hello

    I use Tetra4D Converter to handle my 3DPDF conversion. This allows me to convert some of my files of CAD and graphic information that allows my sales and my Department to manage my models in Acrobat, without any geometric information. Like this, if my sales team want a quote to a subcontractor, no problem, it will not be possible for them to export the CAD dat and use it.

    But you can decide to convert geometries, in some cases, that might help. It's just you...

    For Acrobat security, it depends on what you want to do... More info here:

    Acrobat help. Security

    Hope this will help you...

  • you know a widget for muse or a code (html or javascript) that serve as a visitor counter?

    Hello.

    I'm looking for a widget for adobe muse or an html or javascript code which serve as a visitor counter . I need to be in many pages of the same site, but each of them making a independent metering. I found a javascript script code, but If a put option it on all my pages to the site of the count, share therefore the same show number on each page.

    I know that if I google , I can find some free counters, but always, they have the name of the author and I can't change the code ....

    Nobody knows How can I fix it or some kind of solution?



    Thank you

    Usually visitor tracking code such as google analytic, statcounter, etc. wants to appear towards the end of the HTML body so they can more accurately track visitors who load the entire HTML page and not follow those who begin to load the page and then cancel it. If you paste your statcounter embed HTML in Muse and then place the element of HTML page as a result at the bottom of the page, which should work fine.

    In case you are using Business Catalyst to host your website, you can check reports of backend without the use of widget site visitor.

    Thank you

    Sanjit

  • How can I put HTML codes with muse cc? I have to put a watch on my site, I only codes HTML

    How can I put HTML codes with muse cc? I have to put a watch on my site, I only codes HTML

    Hi Antonio,.

    You can use the object > option to insert HTML code to add your code to the page.

    Kind regards

    Aish

  • I can not installed any program, not even place dating 8007000 b error code from my windows, and for windows live menssenger error is Microsoft.VC 80.le CRT version 8.0.50727.42 _

    I can not installed any program, not even place dating 8007000 b error code from my windows, and for windows live menssenger error is Microsoft.VC 80.le CRT version 8.0.50727.42

    Do a system restore:
    http://www.SevenForums.com/tutorials/700-system-restore.html

    Try to repair:
    http://www.SevenForums.com/tutorials/3413-repair-install.html

Maybe you are looking for