browser

Is it possible to load in a local version of a JavaScript file instead of the server version?

时光总嘲笑我的痴心妄想 提交于 2019-12-21 03:57:11
问题 Just had a quick question to throw out and see if there was a solution for this... Let's pretend I have no access to the server. I load up a webpage and find out that they have a Javascript file loading from a subfolder (let's say /scripts/js/some.js) Now, I want to make changes to this file locally and test it against the whole site without downloading the entire site to a local folder. Does anyone know of a way I can override the loading of that remote js file in favor of a local/edited

How to trigger saved password autofill in browsers?

白昼怎懂夜的黑 提交于 2019-12-21 03:56:11
问题 I have a web application written in pure JavaScript (no pre-generated HTML except for the document which loads all the JS files). This app contains a login form which is created dynamically when the document.ready event event is triggered. I trick the browser into displaying the "Remember password?" dialog by posting the login form into a hidden iframe before logging in using ajax (in Firefox the password appears on the saved password list, so this part obviously works) but saved passwords

How can one detect copying a link in a browser?

送分小仙女□ 提交于 2019-12-21 03:51:43
问题 Yesterday I had a chat with a taxi driver and upon mentioning that I am a programmer, he told me that a couple of days earlier he had experienced the following: upon trying to copy the URL from the address bar of his browser, a messagebox appeared with a message like "Please don't copy this link, rather register" . I am not a web developer, so this might be a lame question :-) but I wonder how such a thing is accomplished? What technology or language gives one this level of control over the

How can I get the page title in WebBrowser control?

旧巷老猫 提交于 2019-12-21 03:47:06
问题 How can I get the page title in a WebBrowser control when I navigate to different websites? xmlns xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" Properties starting with D DataContext DesiredSize Dispatcher DoubleTap xaml tag <phone:WebBrowser Name="browser" Height="760" VerticalAlignment="Top"></phone:WebBrowser> 回答1: I had the same problem. @Akash Kava's answer is almost correct but this is the correct javascript to read the html title: String title = (string

Properly disposing of browser resources

烈酒焚心 提交于 2019-12-21 03:32:45
问题 I have a web application which dynamically loads in data over a long period of time. Within the data there are links to images which are then rendered in the browser. e.g. var object = { Name: ko.observable("Foo"), Ref: ko.observable("Bar"), ImageUrl: ko.observable("http://.....") } I am using Knockoutjs 's template binding to render the data on the screen. <img data-bind="attr: { src: imageUrl }" /> So every time the object changes via an Ajax call, the Knockoutjs template is re-rendered

Faking max-device-width

限于喜欢 提交于 2019-12-21 03:29:15
问题 To implement mobile website it would be useful to set max-device-width in my browser. I know plugins to fake the user-agent. It this also possible for the max-device-width? I would prefer to use a regular browser like Firefox, IE, Opera, ... instead of all kind of mobile browser emulators or even different smartphones. Thanks, Ropo 回答1: Chrome allows you to set device metrics, which are used in the media queries calculation for device width. To do that, open Developer Tools, click the gear

Techniques for logging into websites programmatically

故事扮演 提交于 2019-12-21 03:00:52
问题 I am trying to automate logging into Photobucket for API use for a project that requires automated photo downloading using stored credentials. The API generates a URL to use for logging in, and using Firebug i can see what requests and responses are being sent/received. My question is, how can i use HttpWebRequest and HttpWebResponse to mimic what happens in the browser in C#? Would it be possible to use a web browser component inside a C# app, populate the username and password fields and

Clear Android Browser History

孤街醉人 提交于 2019-12-21 02:58:09
问题 I am writing an application for a client that will have several devices that are open to customers to look at and play with. They want to be able to clear the browser history on a regular basis so that if a customer opens the browser to an inappropriate web site the next customer to come along will not see this. I am currently using this to clear the history and searches: Browser.clearHistory(getContentResolver()); Browser.clearSearches(getContentResolver()); This correctly clears the history

How to hide HtmlElement in webbrowser control

自作多情 提交于 2019-12-21 02:37:28
问题 I have a webbbrowser control that navigates to a page that contains an image, and i want to hide or delete this image from my webbrowser. I've tried to set on DocumentCompleted event the method below with no luck: webBrowser1.Document.GetElementById("imgToHide").Style = "display:none"; How to hide an htmlelement from a webbrowser control? My programing language is C#. Below is my code: private void Form_Load(object sender, EventArgs e) { webBrowser1.ScriptErrorsSuppressed = true; webBrowser1

List all web-browsers installed on a Windows machine

僤鯓⒐⒋嵵緔 提交于 2019-12-21 02:27:06
问题 Is there a common method/api to list all web browsers (name, executable, default yes/no) installed on my machine (and per user), and how to find out which is the default web browser? I have seen this question: How to find all the browsers installed on a machine And on MSDN: How to Register an Internet Browser or Email Client With the Windows Start Menu which states that web-browsers should register themselves under HKLM\SOFTWARE\Clients\StartMenuInternet (and HKCU ) Is that really the common