FAQ Database Discussion Community

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...

is binary file(pdf, word, excel, ppt, mp3,…) download possible using XHR or fetch?

is binary file(pdf, word, excel, ppt, mp3,...) download possible using XHR or fetch? I have seen some snippets and tricks for pdf and images using data URI and base64 conversion. Do we have some better mechanism available? I need to download a file with following constraints: File download request must...

Angularjs is not working on some old browser

Angularjs scripts are not working on some old browsers so I want to redirect users who use these old browsers. How can I understand angular is working or not in client browsers.

the nested while loop do not work, instead it displays unexpected '}'

I used a nested while loop for retrieving data from 2 different tables in sql using php but the browser only displays unexpected '}'. I also tried setting the nested while loop as comment, it executes in the browser fine. I checked every "}" , ";" ," " ", and...

set my website as homepage for android device browser using PHP code

I need to define a button on top of my website which when a user open my website with android device and click on that button, my website set as his homepage on his android device browser. I need to do this with PHP or javaScript if possible.

Change browser proxy settings from Python in Ubintu?

Is there any way to change the firefox and chrome proxy through a python script. System is Ubuntu or any other linux distro

Why/how does the browser decide ☃.net goes to xn--n3h.net

If we type into firefox or chrome http://☃.net/ It takes us to http://xn--n3h.net/ Which is a mirror of unicodesnowmanforyou.com What I don't understand is by what rules the unicode snowman can decode to xn--n3h, it doesn't look anything like utf-8 or urlencoding. I think I found a hint while mucking...

Java Selenium WebDriver with Yandex

At the moment, I use Firefox as browser for my Java Application with Selenium. But Firefox is slow. Is it possible to use Yandex as browser? Didn't find anything in Google. Does Selenium supports Yandex? For Chrome I need the .exe for using Chrome as browser. Is this possible with...

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...

Retrieving document.cookie getter and setter

I'm trying to override the document.cookie since i need to control cookie creation, but seems that getOwnPropertyDescriptor casted on document.cookie doesn't retrieve its getter and setter ( tried on chrome and firefox ). Could someone explain me this behaviour? https://jsfiddle.net/1363ktwp/7/ var obj={}; // creating a property using document.cookie descriptors Object.defineProperty(...

How to make Google Chrome and iOS remember scroll position in div after returning back?

The problem is that the scroll container is a div, not body. And that causes Google Chrome and iOS to fail to remember scroll position of the div after users go to another page and then return back. The related CSS code is as follows. The scroll container is #container....

How can I detect when the contents of a div are unloaded?

I have an application that navigates mostly with AJAX, and a section where a user can view information. I would like to track how long users are viewing different pieces of information. I want to assume that as long as they have the information loaded in the <div> they are...

JavaFX WebViewer on Java 6?

I have at school Java 6 under windows and i can't update it or install the standalone. I want use JavaFX to have the web viewer in my project. Is it possible use JavaFX under Java6? If is possible, How? UPDATE I want use a web viewer in my project....

NPAPI retirement and the future of digital signature

I understand that browser's companies are not interested about the applications which use Smart Cards, applets, etc, anymore. So, I'd like to ask you guys about the approach that you will be taking from now and then without NPAPI. In my company we are developing a new app which is...

Change permissions to allow PHP script in browser to execute matplotlib operations in a python script

I am running Ubuntu 14.04 with a locally hosted webpage running on Apache2. I can access index.php fine through my browser, but I want that page to display a graph that is prepared in a python script called graph.py. graph.py will execute fully when the I execute index.php from the...

Looking for tool that prevent script to become unresponsive [on hold]

For a side project I need to generate a lot of data from a WebGL Application. This Web App is mostly a personal tool and I really don't care if my browser become unresponsive (I mean, I know it will). Does someone know a browser/tool/plugin that could allow me to...

Python in Browser: How to choose between brython, pypy.js and skulpt?

EDIT: Please note I'm NOT asking for a (subjective) product recommendation. I am asking for objective information -- that I can then use to make my own decision. I'm very excited to see that it is now possible to code Python inside a browser page. The main candidates appear to...

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...

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?...

Does {} consume less memory than [] for nested objects in Javascript?

I had some legacy JS code that creates a giant nested object structure with []. The code goes some like this var data = []; data ["first"] = []; data ["first"]["second"] = []; data ["first"]["second2"] = "hello"; It is about 250+ KB of javascript, which is fairly large. When I...

What do I need to do to my HTML to allow accented characters to properly display?

I have HTML like this (combination of English and Spanish): <p><em><span class="consolas">In </span><span class="english">English</span><span class="consolas"> and </span><span><strong>Spanish</strong></span></em><em><span class="consolas"> / En </span><span class="english">Inglés</span><span class="consolas"> y...

Altering window.print() Javascript functionality [duplicate]

This question already has an answer here: Print <div id=printarea></div> only? 21 answers This question is mostly out of academic interests(and partly because I faced an issue like this before and simply found a workaround, but I want to know the proper way to do it). How does the...

Why doesn't JavaScript get its own thread in common browsers?

Not enough that JavaScript isn't multithreaded, apparently JavaScript doesn't even get its own but shares a thread with a load of other stuff. Even in most modern browsers JavaScript is typically in the same queue as painting, updating styles, and handling user actions. Why is that? From my experience an...

close and open browser -selenium C# Visual studio

I want to close and then open the browser without close the driver of selenium, using C# I don't want to: driver.Quit(); How Can I close and the open again the browser Chrome?...

Add possibility to launch commands from browser

I have a simple browser in python #!/usr/bin/env python import sys import gtk import webkit DEFAULT_URL = 'http://www.stackoverflow.com' # Change this as you Wish class SimpleBrowser: # needs GTK, Python, Webkit-GTK def __init__(self): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_position(gtk.WIN_POS_CENTER_ALWAYS) self.window.connect('delete_event', self.close_application) self.window.set_default_size(350, 20) vbox = gtk.VBox(spacing=5) vbox.set_border_width(5) self.txt_url = gtk.Entry() self.txt_url.connect('activate',...

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...

Chrome complains of MIME type wrong

I have created a simple PHP script which downloads files (sends them to the browser). The script sends the browser the type of document, for example MIME type "application/gz" for example document test.tar.gz However, on receiving the document Chrome complains: Resource interpreted as Document but transferred with MIME type application/gz...

return info after Twilio client outgoing call

Im trying to find a way to return information when placing an outgoing call through the twilio softphone in the browser. When I place an outgoing call my application invites the remote party to a conference room throught the rest api, and the agent is invited to that same conference...

Elasticsearch PUT documents in strange order

How do set elasticsearch to be adding new documents with PUT method at the end (or the beginning). Now it's adding new ones sometimes at the end, sometimes in the middle. I know I can sort results by some field, but I want to see them in browser just ordered...

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?...

Can't open localhost in Project Spartan in Windows 10 preview

I installed Windows 10 preview and installed IIS. Open "http://localhost" in Project Spartan can't connect. IE has no problem. What's the problem?...

How to enable HTML5 videos in qutebrowser?

qutebrowser is not that popular, so I couldn't google an answer to my question, I want to be able to watch youtube etc... Please help this is the only thing stopping me from using a great browser

Responsive HTML not reacting as expected in different browsers [closed]

So I am making a website but some weird thing is happening. Like, you can see it happen by yourself, it's pretty staight forward; try opening this link into Chrome and Firefox (for example). Chrome reacting just fine, and not Firefox. As the two files are pretty long, I pasted...

Why do not these items appear on firefox browser?

I have this page: http://paul.dac-proiect.ro/ In Chrome all is well but look as displayed in Firefox. <div class="social" style="float:right"> <div id="facebook"></div> <div id="twitter"></div> <div id="link"></div> </div> .pozitie{position: absolute;top: 200px;left: 39;color:#f9f9f9;"} /* IMAGINI HOVER SOCIAL MEDIA */ #facebook { background-image: url("http://placehold.it/26x26"); width:26px; height:26px; float:left; margin-right:5px; } #facebook:hover { background-image:...

How is this string processed by the browser?

I'm using a JQuery snippet to make a navigation bar stick to the top of the window after the user scrolls down to a certain height, although I know the result of the string below I'm not completly clear on how the browser processes it. $('#navbar') .addClass('original') .clone() .insertAfter('#navbar') .addClass('cloned')...

How can I add custom search engine to browser?

Basically what I'm trying to do is to be able to add my own "search engine" (based on PHP and Mod_rewrite) to any browser automatically. Somewhere on the Internet I found that I need to declare a search provider. How can I do this? <link>, manifest or some JavaScript?

Scroll the mouse changes the value of my select element

I'm having problems with mouse scroll in some browsers, if the user goes up or down within my website affects selects several values that I have. This happens in all browsers and I figured there was a way through by javascript could cancel the event or to cancel the values...

How to modify the content of WebRTC MediaStream video track?

I use WebRTC in a scenario in which the client video stream is recorded on a third-party server https://tokbox.com/. I would like to put some kind of watermark in the recorded video. Investigation brought me to this page http://w3c.github.io/webrtc-pc/#mediastreamtrack and it seems that it is technically possible since it says...

Cannot find the CSS Errors in Chrome

I'm trying to debug a website and in Chrome's inspect element I'm seeing 8 errors and 1 warning. The Warning shows up right next to the problem. However, the Errors don't show up anywhere and I can't locate them. Also, the errors and warnings show an underline when I hover...

How to run a .jar inside browser?

I tried to execute a .jar using HTML or PHP. In the first case i wrote the code bellow: <applet code=Diagnostica.class archive="Diagnostica/Diagnostica.jar" width="120" height="120"> </applet> This way dosen't work cause the file Diagnostica.jar need to contain an applet i suppose. So i tried the second option in PHP: exec("java -jar...

Why is it so hard to style