WebBrowser Control not showing PDF anymore - c#

Googled really much on this issue, but didnt find any related problems.
I wrote a Browser with WinForms and the webbrowser control and since a week ago the Browser is showing a little Icon on the top left corner with an "x" in it instead of PDF File on every Website.
Dont know why, cause it worked fine for a couple of months.
Also tried to change back to the IE9 Engine by setting the registry entries, cause i thought about some IE Updates. But didnt work.
Any suggestions?

Found the source of the problem. The trick is to build a x86 application. If you set any cpu or x64 platform in your build settings, this little box with the "x" will show up when you try to view PDFs.
But really dont know why this happens and why he can find addons from IE in the webbrowser control, cause i didnt use any one of them in my code and im also not using any dlls for this. And why IE is showing PDFs without Addons activated.
But its working again now.

Related

Webbrowser control stopped showing instagram

I have windows forms app which has a webrowser control. I am using it to login to instagram. Until today it worked just fine. Today it started to give the script error and stuck at the splash screen.
To see if it is because I unknowingly did something on the project, I even created a brand new solution with a web browser and only changed its url to instagram and it gave the same error.
So that made me think two possibilities.
1- As in lots of questions, it is browser version emulation thing, which is solved by reg update. I tried all didnt work. And my webbrowser works in latest version anyway, as you can see in textbox on top right corner. but somehow maybe I didnt apply the solution correctly.
2- Instagram itself somehow detected webbrowser access and blocks me.
If anybody can help, it will be highly ağpprecaited.

Visual C# Programmatically Scroll Web Browser that has a PDF loaded into it

I know there are tons of similar topics to this question, but none have the answer I am looking for.
Basically what I have is a windows form, and on this form is a webbrowser control.
What I am trying to do is use the arrow keys to allow for scrolling of the web browser.
Now when it comes to HTML pages, everything works fine.
I do the normal Document.body.scrollTop to scroll the page.
Everything works great here.
The issue is when a PDF is loaded in the browser, The document is null, and I cannot scroll.
I have tried everything I could think of, and I have checked when a document is completed loaded if the sender object has the document filled in, for which it does not.
This kinda makes sense because I am going to assume that Document is for HTML to begin with.
Now my issue is, what do I use to make the browser scroll. I seem to have no viable access point to the window to change its scroll position.

CefSharp. When minimize windows form get grey content

I read about CefSharp and it is really great but there is one problem. I want to use CefSharp with windows forms and it runs. When i minimize the windows and then open it again the content is missing. However, when I resized the embedded browser window, the page appeared. Just as it should.
Some pictures:
Before minimize
After minimize
I use CefSharp directly from GitHub, can you help me to solve this problem. I will be very thankful if you help me.
That's clearly a bug! (And I just reproduced it on Win7 when I don't maximize the window)
I just happened to see http://www.hjerpbakk.com/blog/2014/10/5/windows-forms-cefsharp-grey-content yesterday
Does adding Size = Size, to the BrowserForm constructor fix it for you?
Like this:
browser = new ChromiumWebBrowser(CefExample.DefaultUrl)
{
Dock = DockStyle.Fill,
Size = Size,
};
Update: Naah forget it that doesn't fix the issue it seems. Please report it as a bug to the CefSharp project so it can be fixed (After all StackOverflow isn't a bug tracker)
Update2: It might be related to problems with EGL. It looks like a workaround is to remove or rename the libEGL.dll in the bin folder. Note a rebuild of the CefSharp.Example.WinForms app will copy it there again!
Update3: With CefSharp v33.0.2 this should be fixed.

How to disable silverlight in IE webdriver?

Here is what I got:
an upload button, which works through silverlight if it is installed, or through html5 if there is no silverlight. So, I have 2 browsers to test: Chrome and IE. I did common uploading by sending keys to input element and it works good in chrome, but when it comes to IE - it is trying to use silverlight.
My question is how to disable silverlight or maybe there are some workarounds?
I found out that it is an add-on, so if somebody knows how to disable add-ons or launch iedriver with switches, please, let me know.
I looked through many documents about webdriver and it seem to be no way to disable add-ons or add switches for now. I hope this will save somebody's else time.

How to pop a web browser from Silverlight OOB?

I want to pop a web browser popup window, with a given url, from Silverlight.
When running within the browser I use HtmlPage.Window.Invoke() to run a javascript and its window.open() in the host browser. Works fine.
But when I run out-of-browser (OOB) this technique obviously doesn't work. So, what to do?
Silverlight 4 has this new WebBrowser control for use when running OOB. It works fine, but I have only been able to run it in a child window within the silverlight application boundaries.
Then there is this hyperlink trick. Also works, but it creates a new tab in the current browser-instance. Not exactly what I want either.
Anything I have missed?
(Alternatively; is there a a way to make the hyperlink pop the url in the same browserinstance and tab every time? instead of creating new tabs.)
Bit of a long post this. Sorry about that and thank you for your patience.
The link you posted to creating a derived HyperlinkButton is the only one I know of. Maybe play around with different TargetName values to see which one works like you want? "_blank", "_new", etc... - one of them may be what you want.
The trouble is that different browsers (when set as the default browser) may do different things, so be sure to try this with IE, Firefox, on a Mac, ...

Categories

Resources