browser

Receiving complex javascript values through external interface

一世执手 提交于 2019-12-24 02:07:41
问题 I'm trying to receive and potentially send complex values through TWebBrowser (using TEmbeddedWB) with the provided external object. For example; in javascript I would try to use the exposed method with an array as a parameter: var test = [123, 'abc']; external.someFunction(test); //Or something more complex var complexObject = { someMethod : function(){ return 1; }, someProperty : 123, someArray : ['xyz', 3.14] } external.someFunction(complexObject); Checking the VarType of both of these

strategy to defeat CAPTCHA bypass

≯℡__Kan透↙ 提交于 2019-12-24 02:00:35
问题 I have read the posts and the links about how to decode captcha. What I have not seen are strategies to make it more difficult to do this. In particular strategies that are not really complex. Also, does anyone have any strategies to try to detect if people are bypassing captcha? I am developing browser based game and I need to use something to prevent people from using simple bots to play all day long. There are actually companies out that that sell specialized bots for games. such as this

How do I write browser specific javascript code? [closed]

99封情书 提交于 2019-12-24 01:26:08
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . How do I write browser specific javascript code? for example just to make the code work for firefox or ie using javascript. 回答1: if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x; if (

Problem with Application.DoEvents() while waiting for WebBrowser to finish loading

柔情痞子 提交于 2019-12-24 01:24:33
问题 I'm trying to load WebBrowser content and after that I want to add some text and scroll to the bottom. Here's example of my code: webBrowser1.Url = new System.Uri("file:///" + filePath); webBrowser1.Document.Body.InnerHtml += text; webBrowser1.Document.Body.ScrollTop = webBrowser1.Document.Body.ScrollRectangle.Height; When I run it, there's an unhandled exception "Object reference not set to an instance of an object". Or when I comment line that does the scrolling, then text is added to

Close last opened tab

烈酒焚心 提交于 2019-12-24 00:43:32
问题 Can I close last opened tab (without closing the browser) from Python that was opened with the following code? import webbrowser webbrowser.get("firefox").open_new_tab(url) You can use whatever for this tasks. I know that webbrowser module is not able to do it. 回答1: No, you can't close browser programmatically(without hacking or create plug-in). the browser controller only provide methods to open browser but not to close. this implicitly call new Process then parse command-line arguments such

HTML: How common is it that different browsers render 1em at a different actual px size?

匆匆过客 提交于 2019-12-24 00:42:02
问题 As you know, you can specify dimensions with CSS in px or em. As far as I understand it, em means "line height of the current element's fonts". My approach currently is to always use px (also for margin which seems to be a controversial practice). Question: Can I rely on the ratio of px and em to be the same across browsers ? If not, then my manually specified margins between paragraphs will likely look odd because they so not match 1em anymore. I believe that it is better to use em for

How do I print from the wpf WebBrowser available in .net 3.5 SP1?

喜夏-厌秋 提交于 2019-12-24 00:37:25
问题 we are currently using a winforms WebBrowser control in our app in a WindowsFormsHost and printing by calling 'WebBrowser.ShowPrintDialog()' We have an issue with this in that the dialog does not appear to be modal and the parent window can be dismissed causing issues if a print is later attempted. I was looking at the new wpf webbrowser control in the hope that they will have fixed this issue when doing a similar thing themselves, but can find no way to print from it.. I found someone online

alert box when closing window, but not on reload

雨燕双飞 提交于 2019-12-24 00:33:52
问题 I'm searching for a way to let my users know that they have to log off when they are closing the window. I've already founded this code: window.onbeforeunload = confirmExit; function confirmExit() { return "It is better if you log out, before you close this page!"; } $(function () { $("a").click(function() { window.onbeforeunload = null; }); }); This works perfectly when I close my page. just as I want, but it also shows when I reload the page, which shouldn't happen. Anyone an idea how to

Can a malicious user on a web application manipulate the inputs (beside the form data) that is sent by the front-end of web application?

心不动则不痛 提交于 2019-12-24 00:33:18
问题 Are there any possible ways by which a malicious user on a web application can manipulate the input that is sent by the front-end of web application (not talking about the FORM DATA, of course) but the requests that are sent like for e.g., when I allow him to edit his profile or his content, he may manipulate the IDs (userId or the contentId) so that he may maliciously do evil with other users content? These inputs are fixed on a webpage & are not editable but still can the users manipulate

In modern browsers, is there any security limitation for JavaScript bookmarklets?

大城市里の小女人 提交于 2019-12-24 00:29:22
问题 I read an article about bookmarklets which says that bookmarklets are so powerful they can be dangerous. For example, a malicious bookmarklet can collect your "cookies", "localStorage", the string in the password input box and then send it to a remote server, which is similar to "script injection". I'm curious about that. Since this article was written in 2007 (8 years ago), is there any limitation for bookmarklets (as well as browser plugins) to improve the security in modern browsers? 回答1: