How to load HTML after LoadString() deprecation - html

I'm using CefSharp WinForms on a .NET project and after upgrading on a version greater than 75.x, I cannot use the method "LoadString" any more. I made some research on web for alternative solution but no luck so far. Some info regarding this issue can be found on "https://magpcss.org/ceforum/viewtopic.php?f=6&t=17231" but it seems that it is not so clear how to solve this problem.
Basically, I was using the above method to load HTML string into the browser (e.g. LoadString("hello world- this is my html", "about:blank")). Now if I use the "LoadHtml" method, I'm getting an empty page.
Did anyone else had a similar issue and found a solution for it?

Related

Swashbuckle cannot change index.html (CustomAsset doesn't exist)

I'm using Swashbuckle for my ASP.NET core project and I want to modify my index.html and I saw this page: https://github.com/domaindrivendev/Swashbuckle/tree/swagger_2.0#provide-your-own-indexhtml that explains exactly how to do that, but the thing is that the method CustomAsset method doesn't seem to exist anymore. I can use the InjectOnCompleteJavascript method and InjectStylesheet without any problem, but there's no CustomAsset to include my html page. Do you know if there's another way to replace the swagger UI?
Thanks,
Claude
I was cursing why this method was not found in dotnetcore.
I moved through from version 1.0.0 of Swashbuckle.AspNetCore and found that at version 1.2.0 a new property appeared called IndexStream
This looks like the new way to provide an Index.html override.

Save generated HTML using Canopy

Can a website's generated HTML be saved using Canopy? Looking at the documentation under 'Getting Started', I could not find anything related.
You can run arbitrary JavaScript using js, document.documentElement.outerHTML will return the current DOM, so
let html = js "return document.documentElement.outerHTML" |> string
does the trick.
Canopy is a wrapper around Selenium that provides some useful helper functions. But it also provides access to the Selenium IWebElement instances in case you need them, via the element function (halfway down the page; there don't seem to be internal anchors in that page so I couldn't link directly to the function). Then once you have the IWebElement object, your problem becomes similar to this one, where the answer seems to be elem.getAttribute("innerHtml") where elem is the elememt whose content you want (which might even be the html element). Note that the innerHtml attribute is not a standard DOM attribute, so this won't work with all Selenium drivers; it will be dependent on which browser you're running in. But it apparently works on all major Web browsers.
See Get HTML Source of WebElement in Selenium WebDriver using Python for a related question using Python, which has more discussion about whether the innetHtml attribute will work in all browsers. If it doesn't, Canopy also has the js function, which you could leverage to run some Javascript to get the HTML you're looking for -- but if you're having trouble with that, you probably need to ask a Javascript question rather than an F# question.

Why can't I add an HTML custom attribute to a visualforce page?

I have an control, to which I want to add a custom html attribute called, previousValue.
The Salesforce Developer's Guide assures me that I can do this by prefixing the attribute name with html-.
So I have an element that appears thus:. I also have the docType="html-5.0" attribute in my page control.
However, in Eclipse I get an 'unsupported attribute' error. I have upgraded to the latest force.com IDE; can any one tell me why this isn't working? What else do I need to do?
Thanks.
After much experimentation, the answer to this seems to be that the salesforce developer's guide is inaccurate and the 'hmtl-' prefix is not supported by the <apex:inputField> component. I can add it without a problem to an <apex:outputPanel> component. Don't understand why this should be so and the whole point to using these attributes is to locate data in a relevant place and avoid complex jquery selects to find the data relative to the location at which it is required.

Dojo build requesting already inlined Dijit templates

I am a developer on a large Dojo project and I am having some issues with the Google Closure compiler.
We have around a hundred templates for Dijit widgets so the plan was to make the Closure compiler inline the HTML in the JavaScript file rather than require them AMD style.
To achieve this I changed the "mini" parameter in /profiles/app.profile.js from true to false.
When compiling, everything seems to work fine, even when running the app i have no issues but something strange happens.
Even if the HTML templates are correctly inlined in the dojo.js file, dojo is still making HTTP requests to the corresponding template file to the server !
By inspecting a "beautified" version of what the Closure Compiler produced I can observe that each HTML template is present in two different places :
1) Inlined in the JavaScript in the following format :
"url:path/to/my/template.html":"<p>Some more HTML</p>"
2) As a required pseudo-module in the AMD require :
dojo/text!./path/to/my/template.html
I searched the bug reports on their website in the BuildSystem category : BuildSystem but ultimately couldn't find any relevant help.
Is this me just wrongly using the Google Closure Compiler or is this a open / unreported bug ?
How can I fix this issue ?
Thanks a lot in advance !
If you are referring to an issue that only exists in 1.9.0, then it is https://bugs.dojotoolkit.org/ticket/17141.

QT HTML Parser (+XQuery)

I'm looking for a QT HTML parser tool.
I have some html source code and I'd like to use XQuery on it.
I already tried using QWebPage + QWebElement, but I don't like this solution cause firstly it doesn't works on non-gui thread (because of QWebPage) and because we can't apply XPath but CSS Path.
The other solution I tried is QXmlQuery, it works great, but the only problem is that it doesn't works if there is an error on the page. For example, the first page I tried was missing systemId (in the DOCTYPE tag), so the parsing was aborted.
I heard we can use gecko for parsing but I have no idea how to use it with QT.
Have you some suggestions ?
Thanks
I recommend that you use tidy on your HTML page and then process it with XQuery.
Zorba is a C++ XQuery processor that provides a tidy module.
You can find a live example at http://www.zorba-xquery.com/html/demo#tQZu6aq1K4KoGJm9m0oIPwKRt04=
BaseX got a QT client and can use TagSoup for cleaning up HTML documents.
I'm sorry I cannot provide you with an QT example as I don't know QT at all.