FAQ Database Discussion Community

Determine browser's default text highlight color using JavaScript or Dart

The browser's default text highlight (selection) background color can be overridden, e.g.: ::selection { background: #ffb7b7; } And the color is browser/OS specific. Is there a way to read the browser's default value using JavaScript or Dart?...

Xaml Browser Application opens as a download file on client machine

I have a Xaml browser application that I deployed on my computer. It seems to run fine and open on my computer in Internet Explorer. When I try to access it from client computer on the same network, it opens the application as a download file on Internet Explorer. I...

Python script to dynamically find the port to which firefox listens on opening a url?

Is there any way to find the port firefox url listens to when we open a url. platform - ubuntu or any other linux distro

Why window or document can't be set to undefined or null?

This might be a silly question but I haven't found an answer to it. Why can't we do the following? window = undefined OR document = undefined I know those are globals and are available in browsers but thinking of how JavaScript works, is it not possible? Are those re-evaluated...

website not working on Internet Explorer

I have a vertical menu in a side bar with a hover over submenu however in IE the hover menu decides to appear in the middle of the page. I'm using IE11 so it doesnt support the IE only css. I'm not sure what has cause the problem..here is a...

How to remove/replace cached css and js file from client Browser?

Is there a way by which we can replace or remove the cached css and js files from client browser when they come to the website next time?

How to get particular controller scope list in console - angularjs?

I am trying to edit bus list in browser console for this bus search angualrjs site. I tried to access the filteredBusData(ng-repeat) list in that page which is used in ng-repeat from console. Code: Method 1: angular.element(document.body).injector().invoke(function ($rootScope) { scope = $rootScope; console.log(scope.filteredBusData); }); Method 2: angular.element('[ng-controller="busTicketCheckoutCtrl"]').scope; `busTicketCheckoutCtrl` is the...

HTML empty DIVs not well rendered by browsers

I receive XHTML documents that sometimes contain the following code: <div align="center" /> My problem is that browsers (Firefox 38.0.1, Chrome 43.0.2357.65) display this code as an opening <DIV> tag and not, as I expected, as an empty div (<DIV></DIV>). The rest of the document is, therefore, completely messed up....

How often is garbage collected?

If I understand correctly the GC works like this: MyClass.prototype.render = function(){ var largeArray = []; for (var i = 0; i < 1000; i++) { largeArray.push({ firstName: 'John', lastName: 'Smith' }); } } When render() is called, largeArray is marked for garbage collection but not immediately collected. I am...

Unable to view changed text within WebBrowser control

I'm trying to change/filter the text within my WebBrowser control, but it doesn't appear to be working. Here's the code I've tried: private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { webBrowser1.DocumentText.Replace("","KM"); } At first I thought the DocumentCompleted event wasn't firing, so I assigned it to a button click I could...

How can I have a different behavior in this JQuery script if the browser is Chrome?

I am absolutely new in JavaScript and JQuery and I have the following problem. I have to modify a JQuery script so that it has a different behavior when the browser is Chrome. This is my script: $(document).ready(function () { $("thead.opening").click(function () { alert("INTO second function"); $(this).next().css('width', '10000000 em'); alert(modified);...

Can't get Python to download webpage source code: “browser version not supported”

So I'm trying to write a program that would download the source-code of a webpage in Python 2.7. The code looks like this: import urllib2 url = "https://scrap.tf/stranges/47" req = urllib2.Request(url, headers={'User-Agent' : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.30 (KHTML, like Gecko) Ubuntu/11.04 Chromium/12.0.742.112 Chrome/12.0.742.112 Safari/534.30"}) con = urllib2.urlopen(req) data =...

file_get_contents() function loads different page compared to broswer

I am trying to find next page's link of a particular page(i call that particular page as current page here).The current page in program i am using is http://en.wikipedia.org/wiki/Category:1980_births The next page link which i am extracting from the current page is the below one http://en.wikipedia.org/w/index.php?title=Category:1980_births&pagefrom=Alexis%2C+Toya%0AToya+Alexis#mw-pages But ,, when file_get_contents()...

Javascript race condition?

var len1 = $("div").length // can a new div inserted here? var len2 = $("div").length console.log(len1 === len2) // always true? Is it possible for some rogue script to insert a new div between jQuery calls?...

Socket.IO/Node.JS execution

I'm new to both Node.JS and Socket.IO, so I decided to pick up a simple chat client as my first project. To my knowledge, it structured correctly, but I'm being thrown an object expected error whenever I try to run index.js. Anyone know what's up? (if it helps, I'm running...

Selenium catch popup on close browser

I'm trying to test that when I close my window a popup shows with a warning message. I've tried both driver.close() and driver.quit() after making sure I'm on the proper window but this just terminates the process since my popup doesn't show. I could test it by using the awt...

Why is it so hard to style