FAQ Database Discussion Community


close and open browser -selenium C# Visual studio

c#,selenium,browser,close
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?...

Browser using c# in windows form applications

c#,html,windows,forms,browser
i have developed a browser using c# in windows form applications, now i want to put a button to store html code in a text document, how do i do that, thanks namespace browser { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button3_Click(object...

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

python,html,browser,urllib2,source
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 =...

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

php,android,browser,website,device
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.

NPAPI retirement and the future of digital signature

java,google-chrome,browser,npapi
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...

Add possibility to launch commands from browser

python,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',...

Firefox and SSL pages - takes very long on certain sites [closed]

firefox,ssl,browser,ssl-certificate
I use openSUSE 13.1 and Firefox 38.0.1. On some pages with ssl it takes minutes until the connection is established. It only happens on sites whose ssl certificate is not trusted by firefox, so that it asks you if you really want to enter the site. But even this security...

Google Chrome Add Bookmark Image

html,html5,google-chrome,browser,web
Recently Google have added a new interface when users click the star icon in the address bar to add a site to their bookmarks. The UI displays the page title as well as anything from the meta description element if present, but I was wondering if there's a way to...

How to prevent iFrame actions from causing outer page to scroll to it

javascript,iframe,browser,scroll
First, I know there are many questions about this phenomenon but none of the workarounds given so far would help in the situation I have here. Environment: My code is in the Outer iFrame inside a page I don't control. It's sized to fit all my content so no scrolling...

rails 2.3 server running inside vagrant environment not accessible in host machine mac os x browsers

ruby-on-rails,browser,vagrant,hosts,mongrel
in vagrant I am using: box 'prorail/centos-5.8-x86_64' in vagrant i am running rails 2.3 server like: [[email protected] myapp]$ script/server => Booting Mongrel => Rails 2.3.5 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server in my hosts file i have added this line at...

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

javascript,browser,requirejs
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...

Disable browser adding overflow:hidden on touch screen enabled devices

html,css,google-chrome,browser,touch
I'm having an issue with browsers (maybe just Chrome) adding css rules on touch enabled devices. On a website we've created for a client (to be used exclusively in Chrome), when accessing from their ultrabooks, the scroll bars disappear on elements on the page that had them. The client is...

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

javascript,html5,browser,download,xmlhttprequest
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...

How to show/hide a jquery script only on Firefox

javascript,jquery,firefox,browser,cross-browser
Trying to show and hide js only on Firefox browser. There are another question about Detect all Firefox versions, but it is not answer of my question so i have asked this question. HTML: <div id="about_me"> This Text color will be change </div> Show this only on Firefox: $("#about_me").addClass("red"); I...

How to make a browser console wait in a javascript

javascript,browser,console,wait
I'm trying to make a script that clicks on a page button, waits X seconds (for the result of the click to take place), and then continues. How can I do that? (only the wait part)...

file_get_contents() function loads different page compared to broswer

php,html,file,browser,hyperlink
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()...

Detect browser close event

javascript,browser,cross-browser,onbeforeunload
I want to capture the browser window/tab close event. I have tried the following But not working: <script type="text/javascript"> window.onbeforeunload = function(){ myUnloadEvent(); } function myUnloadEvent() { alert ('Calling some alert messages here'); } </script> <body> Body of the page goes here. </body> Tried these links also but no more...

How To Open A Website's (Built on Wordpress) PHP file in my browser?

php,wordpress,browser
I came across a website and liked its look. So, I wanted to know how its style.css is coded. I got there style.css file by visiting to Network Tab of Inspect Element and then opening that file in a new tab. We can open JS files also in the same...

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

javascript,python,browser,brython,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...

How is this string processed by the browser?

javascript,jquery,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')...

Why does my subdomain only work in Chrome?

php,.htaccess,google-chrome,browser,subdomain
I've added a Virtual Host to my httpd-vhosts.conf file like this <VirtualHost *:80> DocumentRoot "/website/sub" ServerName sub.localhost </VirtualHost> I also have two .htaccess files (for the moment identical), one for localhost and one for sub.localhost website/.htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [QSA,L] website/sub/.htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME}...

Yii: Redirect in controller to external site in new tab

php,browser,yii,controller
Is it possible to redirect to an external url inside a Yii controller and open the new page in a new tab? $this->redirect("http://www.google.com"); This works fine, but opens in the same tab. Is there a way to open the url in a different tab? Thanks...

return info after Twilio client outgoing call

javascript,php,browser,twilio,phone
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...

How to detect wake from sleep in the browser on iOS/Android?

javascript,android,ios,dom,browser
I want to be able to refresh the page when the user returns to page from a different tab or by waking the device. I could have sworn that I read somewhere that the pageshow event would be fired from the window, but that turns out not to be the...

How to modify the content of WebRTC MediaStream video track?

javascript,html5,video,browser,webrtc
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...

Safely query size of element soon after inserting it to DOM

javascript,dom,browser
Is there an way (maybe an event?) to delay querying the height of element until all of the styles for it have been fully calculated, so that I know that it's height is calculated properly? In my app I need to get the height of an element as soon as...

Change browser proxy settings from Python in Ubintu?

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

website not working on Internet Explorer

internet-explorer,browser,cross-browser,hover
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...

CSS Font Fallback for Missing Glyphs

css,browser,fonts
CSS: p { font-family: Gill Sans, SFU GillSans; } "SFU GillSans" is a font for Vietnamese language. According to this link, if p contains a Vietnamese character that is not in Gill Sans font, then the browser will look for it in "SFU GillSans" font. Is it possible to switch...

How to enable HTML5 videos in qutebrowser?

html5,browser,plugins,archlinux
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

Java Selenium WebDriver with Yandex

java,selenium,browser,selenium-webdriver,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...

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

javascript,jquery,html,ajax,browser
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...

How often is garbage collected?

javascript,browser,garbage-collection
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...

Android Stock Browser - Not responding to class changes

javascript,android,css,browser,android-webview
For my web-page, things work fine on Android API level 21. But when I test the same page against Android API level 18, some features do not work. When I toggle class "check" on .div1 with javascript. The .div2 display is not updated. Here is sample HTML and sample CSS...

Creating meta-data for binary chunks for sending via WebRTC datachannel

javascript,browser,blob,webrtc,rtcdatachannel
I have a datachannel connection between two browsers, and would like to break a file into chunks and send them to/from the clients. I can read the file and break it up into chunks just fine. However I need a way for the receiving client to know which file the...

Check if ionic app is in dev serve mode(browser)

javascript,browser,ionic-framework,ionic
I use ionic serve to run my app on localhost. how can I know when I'm in browser and not in android? I tried: navigator.platform // MacIntel navigator.platforms // undefined ionic.Platform.is('BROWSER') // false navigator.userAgent // ...iPhone... => i'm in chrome device mode Thank you!...

Is it possible to get specific static contents of a webpage only using client side technology?

javascript,html,html5,browser
I am only allowed to use client side technologies such as HTML5 Javascript ect.. Is it possible to get specific contents of a webpage using these technologies alone?

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

php,mysql,apache,browser
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...

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

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

HTML empty DIVs not well rendered by browsers

html,browser,tags,xhtml
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....

jQuery - Listen to User click on the Auto Suggest Option provided by browser

javascript,jquery,browser
This is my input box. <input type="text" class="form-control" id="contestCode" name="contestCode" required > My jQuery Snippet which checks for keyup event and paste event $('#contestCode').on({ keyup : function(){ checkContestCodeIfExists($(this)); }, paste : function(){ checkContestCodeIfExists($(this)); } }); But when the user clicks on the autoSuggest provided by the browser (Code exists for...

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

javascript,jquery,html,css,browser
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);...

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

php,python-2.7,browser,permissions
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...

Is it possible to interact with an arbitrary client peripheral from a webapp?

javascript,browser,camera,peripherals
I know a webapp can access media devices like microphones and webcams, and other hardware like a smartphone's GPS. As far as I know, that's done with tightly constrained protocols for each specific type of device. However, I have an advanced scientific camera. It is only useful with a computer...

Unable to view changed text within WebBrowser control

c#,browser,text,replace
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("10.86.190.30","KM"); } At first I thought the DocumentCompleted event wasn't firing, so I assigned it to a button click I could...

How is it possible that browserify can make server code run in the browser when servers need access to things like sockets?

javascript,node.js,browser,browserify
Am I simply ignorant of the features that some browsers offer or does this library use some strange workaround to implement these features?

Changing URL as long as you are scrolling the webpage

javascript,html,url,browser,browser-history
I was seeing the NASA's press release / image gallery, (you can see it here) and it has come to my attention that as I'm scrolling down the webpage and seeing different posts, the URL in the address bar was changing (I was using chrome, but tried in Internet Explorer...

Will Microsoft Edge support userscripts?

javascript,browser,userscripts,microsoft-edge
Did Microsoft announce whether Edge will support userscripts? Doesn't matter if via plugins (similar to Greasemonkey in Firefox or Tampermonkey in Chrome) or as an out-of-the-box feature.

place 1 label top, 1 input bottom and 2 buttons left

html,html5,css3,browser
I would like to place 1 label at the top of an Input with two centered buttons (inside a div) on the right. for the moment my code isn't flexible and I can't easily use my class anywhere on my webpage as It is strongly dependent the #.bu-container height that...

correct HTML pages won't load in IE10

javascript,jquery,html,internet-explorer,browser
I'm editing someone elses webpage for content, by changing the HTML files on the drive, adding text, comments, wtv. I'm not a web designer, so this is the only way I knew to do it. On most browsers, my changes show, but on internet explorer, sometimes it will revert to...

How to STOP browsers from sharing session amongst tabs?

javascript,jsp,security,browser,spring-security
How to NOT share session between multiple browser tabs ? I am using Spring Security in JSP/Servlet application and I want to know "How can we achieve the behavior with Spring Security where user is forced to login again whenever he changes the browser tab ?". Disclaimer Question is similar...

Open a html document with php

php,browser
I have a strange setup at the moment (busy with a migration) I have a 4th Dimension application which calls php scripts (which is our soon to be, only application. Dropping 4D) This script thats called from 4D needs to open a html file in the browser. Is this possible?...

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

iis,browser,windows-10,microsoft-edge
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?...

Android Old Browser not Deeplinking mobile application

javascript,android,browser,deep-linking
I have a mobile app which is available for Android and IPhone. For this i have a website where I have a javascript method which checks whether the user is accessing the website from mobile device or other. If it's a mobile device, i'm invoking my installed mobile app, if...

IE11 slow / freeze with AngularJS's ng-repeat rendering

javascript,angularjs,internet-explorer,browser
Currently I have a very sublte problem to solve with IE11 and AngularJS. My page consists of two nested ng-repeat to create a tabset with a table inside any tab. Here the code: http://pastebin.com/0fffPz5Z In the code, each application's object have around 1.000 item's related objects. With a Chrome, Safari...

Open a PDF in a new window of the browser with angularjs

angularjs,http,pdf,browser,get
I'm new to angular js and I wish to open a PDF document in a new window of the browser after pressing a button. I make a GET request with $http.get() at front end, at backend there is a Java rest service that respond to the GET and generates a...

Android webview: controlling which browser is used on redirection

android,browser,webview
So I wanted when I use window.location in my webview, the page to be shown on the same page and to not open a new window with the default browser, so I added this code: view.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return false; }...

Elasticsearch PUT documents in strange order

c#,.net,browser,elasticsearch,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...

Altering window.print() Javascript functionality [duplicate]

javascript,browser
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...

I can't run my own applets in browser

java,security,browser,applet
I can't run my Java applet in any browser - Java blocks it for security reason. I have Java 8, so I can't set security settings to medium. What I have to do? (in my own applets I mean applets that I wrote and it can't harm anything)

Load javascript in consecutive order after browser load event

javascript,jquery,html,html5,browser
What am I trying to do? In an attempt to speed up my website I am loading non-essential javascript after the browser load event. (So the JS files are not render blocking) This is currently functioning correctly. What is the problem? The problem is sometimes the non-essential javascript depends on...

JS Browser with pause function, help please

javascript,function,browser
I wrote this program in js that goes through a list of URLs, where it stays on each page for a few seconds, closes the current window, and open the next in line. Everything works perfect, now I need it to stop/pause every 5 links. The second part of this...

Open popup window in specific keyboard language

javascript,jquery,html,browser
I have code like this that open new window in javascript: window.open(URL); But although browser keyboard language at opennig moment for example is 'fa' but new window opens in 'en'. Is there a way that I can open new window in the same keyboard language that browser uses? Thanks....

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

javascript,browser,architecture,software-design
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...

How to change favicon right align inside the browser address bar

html,browser,favicon
I'm facing this problem and don't know how to change my image-icon address to be displayed with right align? <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"/> Updated to be like this one, but there is no change <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" style="text-align: right;"/> ...

Whats the connection between the browser and the Internet?

browser
How does a browser fit in to the internet? The router connects you to the ISP servers and then you get connected to the internet, correct? How does the browser take your computer and relate it to the internet?

JavaFX WebViewer on Java 6?

java,browser,javafx,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....

Xaml Browser Application opens as a download file on client machine

c#,wpf,xaml,browser,xbap
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?

javascript,dom,browser
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?...

Don't allow user to submit a form with empty fields in ruby on rails

ruby-on-rails,ruby,forms,browser
I am starting use Ruby on Rails and I am having a little problem. I have a form with 3 fields, this is the code: <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> <%= devise_error_messages! %> <div class="field"> <%= f.text_field :name, autofocus: true, placeholder: "Name" %> </div> <div class="field">...

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

url,browser,unicode,character-encoding,iri
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...

Cross-Browser simulator for testing

google-chrome,internet-explorer,firefox,browser,frontend
I need to test my application on several browser versions, is there any smart way to do that? I need a browser simulator in order to switch between browsers and versions.

How does the -tag work in Chrome?

html,browser
I'm curious about how the <img>-tag works. I can set an URI as src, like: <img src="./logo.jpg"/> I can also set a API url, like: <img src="https://avatars.githubusercontent.com/u/449?v=3"/> In my understanding, the <img>-tag will init a get call with the url specified in src and render the jpeg binary returned. But...

How can I add custom search engine to browser?

search,browser,manifest,provider
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?

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

javascript,browser
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...

input value undefined javascript

javascript,css,dom,browser
I want to show an error message when text box is empty on submit, but is not working and everytime I try to get the value through the console area returns undefined. CSS <style> #error_alert { visibility: hidden; border: 1px solid #F00; text-align: center; width: 100px; } label, input, button...

Retrieving document.cookie getter and setter

javascript,cookies,browser
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(...

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

javascript,html,css,browser,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?...

Why is it so hard to style