Cefsharp can work with offlinescreen and true window modes in the same applicaiton? - cefsharp

I hava a application, it's shell is winform with cefsharp, there is an image which rendered by a cef offscreen process inside.
it seems to be working well... but, it is said that mixing rendering modes can lead to unknown bugs...

Related

Links inside of a Xamarin.Forms/Xamarin.Android WebView won't work

I have a Xamarin.Forms app that opens locally saved HTML files which contain relative link to each other (think an old HTML offline docs) in a WebView. Everything functioned in Android 10, but now I needed to make a custom renderer in Xamarin.Android due to the new Android 11 changes needing AllowFileAccess (I have all accesses currently on for testing until I get this problem fixed) in the WebSettings. The WebView's OnElementChange sets all the Control's settings, sets the WebClient (which has a ShouldOverrideUrlLoading set to handle particular filetypes like PDF), and then loads the URL. The first page loads fine, but none of the links operate (this testing page has a few links to other HTML pages and some to PDFs). Click on the highlights them as normal, but nothing opens.
No breakpoints in the WebClient's ShouldOverride are hit and neither are any in the Android WebView's OnElementChanged when I click a link. The output window registers the touch, but doesn't do anything more. I feel like this is some kind of communication problem between Xamarin.Forms WebView and Xamarin.Android WebView (possibly even the Xamarin.Android's WebView not being up to date with Android's WebView), but I do not know where to look. Has anyone run into a similar situation and have a fix to get the links functioning again?
Thanks.
After much blood, sweat, and tears, mostly tears, I found the solution.
First off, WebView doesn't tell you directly, but anything that targets a new window (IE _blank and potentially others) will not hit your WebViewClient's ShouldOverrideUrlLoading method and instead hit your WebViewChromeClient's OnCreateWindow method. So you need to handle loading through that one as well as through your WebViewClient.
Second, links will not always work because of Safe Browsing in the WebView. Again, Google doesn't specifically say it can cause issues with urls, but it works against outside urls (which in a file is potentially every url). I had to turn it off, which you can find instructions at developer.android.com/guide/webapps/managing-webview, and I was able to navigate just fine. I feel you will want to set up safeguards to prevent people from abusing your app (like having a WebView that is for your stuff with Safe Browsing off and another for all others, or blocking any sites that aren't yours) since cybersecurity is always a thing.
Lastly, I found IFrames won't load properly if you manually load the page in the view passed to WebViewClient's ShouldOverrideUrlLoading. The sizing goes all off in my docs, which leads me to believe the elves in the background do something special if you return false and the WebView handles it. I found I needed to handle all my other cases (IE pdfs, images, etc) and then return false from ShouldOverrideUrlLoading if it is my iframe htmls.
As a note, because I had forgotten this having worked on Windows for so long, remember that Android's base file system is case sensitive, which makes links case sensitive. You need to either makes sure all your casing is correct in your files or have them on a FAT file system SD card if you want them to be insensitive.

Use Autolayout Not Checked, Still get constraint errors

I do not use autolayout. My app is incredibly dynamic, in that users can drag fields onto a canvas to create forms. Therefore, I have developed my own routines to render my xibs on any device in either portrait or landscape. To do this, I make sure the Use Autolayout is not checked for the xib's view in the file inspector. In fact none of the boxes are checked (trait variations, safe area, etc). However, I continue to get constraint errors. Is this just a bug. My code works perfectly but it is quite annoying to get the plethora of warnings in the output window. This just started in the last release or two. I am using XCode 9.2 with a deployment target of iOS 11.

Keep QDialog on top of everything, even fullscreen applications?

On a project I work on, using Python3 + PySide, I try to print a popup-message as some sort of notification.
This popup needs to be on top of everything, this includes fullscreen applications like games or browsers. And that's the point that does not work. It works fine for all windows on my Desktop, normal windows, maximized, but as soon as there is a fullscreen application or a borderless window ("pseudo fullscreen") the popup is created, but "behind" the fullscreen app.
I already use self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) but this flag does get ignored by other fullscreen apps.
How do I fix this? Also without giving focus to the popup.
It is just there to present information, and it is not good when your window looses focus while playing a game.
My code can be found here: https://github.com/GosuSan/PyECM
additional Info:
- my project aims to be cross-platform, so I need a platform-independend solution
- I am running linux, without having a windows machine atm,
so I can't test stuff there.
If you need any more info, let me know!
Edit:
It seems that PySide.QtGui.QSystemTrayIcon.showMessage does what I want, it works on fullscreen as well as on borderless-windows. So I will try to either find out how those messages are displayed on top, or just use them, not sure for now.

Cross browser Testing

Due to Bootstrap upgrade, there has been lots of changes in the CSS in all pages of the web application that I'm working on. This application is also mobile optimized. So I have the task the checking the UI of all pages of our application accross most browsers - IE8,9,10,11 , chrome, firefox, ios and android devices(phone, 7 inch, 10 inch).
Right now, I'm opening the existing version(old bootstrap) and the updated version(New bootstrap) of my website in 2 tabs, and switch back and forth between them to find out any UI issues like alignment and color change and text size.
Is there a better way of doing this?
Yes there are somewhat solutions to it, which make cross-browser and multiple device testing easy. Some of them are:
Ghostlab: allows synchronized testing which means if you click or scroll in one browser it happens across all browsers. It has many other features but is only for Mac.
Grunt also allows for synchronized testing. Check this article
you can do cross browser testing within a browser using online services such as
Last thing I would mention is xip.io just check it out!!!
Chrome DevTools are awesome for this purpose. They allow you to override settings for different devices by Developer Tool>Settings>Overrides you can override following to emulate
User agents
Device metrics
Device orientation
Touch events
CSS media

Strange Flex Sizing in IE on Server2003

I have a modified version of a flex calendar found Here, and though it looks alright on most computers I've seen, there is a problem on two of the three servers here. Because of the way Citrix is setup here, I need to have it functional on all of the servers.
When it loads, everything is stretched out vertically, and the numbers are missing on the date boxes. If you mouse-over the flex buttons, they jump to the right size, but there is still rendering errors.
The modifications I made had no effect, because the servers give the same results on both my version and the demo version hosted online. As far as I can tell, the servers are identical (IE version, Flash version, etc.)
How can I get it to display normally?
Initial View
After Mouseover
Usual Demo
Demo in bad server
Edit: On the server that renders it improperly, Firefox renders it fine, but Firefox cannot be used for other (unchangeable) reasons.
From the images it appears this is how the SWF appears in the Browser of each server - one good and one bad. Not how the SWF appears in any browser while being hosted from each server.
Sense it is the browser display that is not working correctly I would assume it is a rendering problem with the browser and not the server.
1.) The problem could come from JavaScript being disabled in one of the browsers and the view being taken from the embed tag. Check to ensure that it looks the same with JavaScript both on and off.
2.) The height being 100% could also be messing it up in the browser. Try setting the height to a specific value (800px) and see if that corrects the problem.
3.) Make sure that the browsers are the same. Is one IE 7 and one IE 8? If they are the same, check the version number to ensure that all updates are the same for each.
4.) View the site from another computer that is connected to the server.
Number 1 and 2 would be my best guess as a way to troubleshoot.

Resources