w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to use userscripts in a site?(How does Greasemonkey work)
Greasemonkey and Userscripts.org are meant to provide kind of lightweight extensions for the browser, not for the webpages. I.e. you install them as the user inside your browser. Some of the trivial scripts might be incorporated into webpages, but in general, Greasemonkey has some "superpowers" to do things that ordinary JavaScript can't do due to security constraints. For instance, issuing (and reading response of) cross-domain XMLHttpRequest, interactions between frames from different origin etc. Normally Greasemonkey scripts are executed when DOMContentLoaded is fired by the browser (this can be changed using @run-at directive to execute the script before anything is loaded). If the script has @grant none in its GM meta section, then it could be perhaps incorporated into your site, b

Categories : Javascript

how to deploy servlet in Web browser?
You don't deploy to a browser. You deploy to a server. Just deploy to server and start the server the usual way (as you did in Eclipse). Then, just enter the servlet's URL in the address bar of the webbrowser of your choice yourself. It can be exactly the same URL as you see in Eclipse browser's address bar. If necessary, bookmark this URL in your favourite webbrowser so that you don't need to copypaste/enter it yourself everytime.

Categories : Eclipse

How to deploy elasticsearch-head or some other browser frontend monitoring tool on my remote server
I've used Elastic Head in the past. Worked quite well! Edit 1: You don't have to use the npm installer. ES-Head works out of the file system as well. From the docs: git clone git://github.com/mobz/elasticsearch-head.git cd elasticsearch-head open index.html Instead of git clone, you could simply download the archive: https://github.com/mobz/elasticsearch-head/archive/master.zip unzip elastic-head-master.zip cd elastic-head-master open index.html

Categories : Java

cap:deploy not updating gems - need to run cap deploy:stop and cap deploy:start
In order to have automatic bundle: You must require 'bundler/capistrano' in your capistrano config file You must not run your cap deploy with the option no_release To troubleshoot, you need first to ensure that deploy:finalize_update is ran bu capistrano, you could create a scenario that run before "deploy:finalize_update" and just output som debug text to your console, you'll know the if the problem occurs before or after finalize_update

Categories : Ruby On Rails

Using jQuery in Tampermonkey
EDIT: Since Greasemonkey 2.0 you do not (and cannot) use unsafeWindow.jQuery for getting the host page's instance of jQuery. You just use window.jQuery, and // @grant none (or @grant whatever other special APIs you need for non-jQuery things). Sources: https://github.com/greasemonkey/greasemonkey/issues/1952 http://www.greasespot.net/2014/06/greasemonkey-20-release.html Tampermonkey currently (Feb 2015) seems to work similarly by default settings: http://tampermonkey.net/faq.php#Q404 old outdated answer below: Add a directive // @grant unsafeWindow. Also, if you are getting your jQuery reference from the host window object, you won't need the @require line.

Categories : Jquery

Run function from Tampermonkey button
Not sure if you have found a solution to your problem yet, but after many hours of struggling to get a solution that: is easy enough for a beginner (me) portable between Tampermonkey and Greasemonkey and looks like something I might be able to do.... I got this working: function addBtn() { $("#quest_form").each( function () { $(this).before("<input type='button' value='Auto Grind' id='autoGrind'>"); $('autoGrind').click(autoGrind()); } ); } addBtn(); Just four notes regarding this solution: I custom made it for ME, so it might not work perfectly for you I'm VERY new to JS so if I used bad "grammar", I'm sorry. The .each won't be necessary, I had to add LOTS of buttons (removed the code dealing with their ID's

Categories : Javascript

Can latest Tampermonkey / Greasemonkey still not use jQuery AJAX?
jQuery AJAX works fine with Tampermonkey and Greasemonkey, with only one limitation compared to jQuery use in a web page. For example, this cross-origin script works in both Tampermonkey and Greasemonkey: // ==UserScript== // @name _Demonstrate jQuery AJAX from Tampermonkey // @include http://stackoverflow.com/questions/18546180/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @grant GM_addStyle // ==/UserScript== /*- The @grant directive is needed to work around a design change introduced in GM 1.0. It restores the sandbox. */ $.ajax ( { type: 'GET', url: 'https://api.stackexchange.com/2.1/users/621338?site=stackoverflow&filter=!)2R0ltXnW6.fyPDiHJm', dataType: 'JSON', success: function (apiJson) {

Categories : Jquery

Tampermonkey script to edit links in source
Well after fiddling a bit I managed to write a script, here's the code if anyone's interested. // ==UserScript== // @name Google Add // @namespace // @description // @include * // ==/UserScript== var srcs = document.links; var links = document.getElementsByTagName("link"); var scripts = document.getElementsByTagName("script"); var imgs = document.getElementsByTagName("img"); var iframes = document.getElementsByTagName("iframe"); for (i = 0; i < links.length; i++ ) { links[i].href = links[i].href+'?google'; } for (i = 0; i < scripts.length; i++ ) { scripts[i].src = scripts[i].src+'?google'; } for (i = 0; i < imgs.length; i++ ) { imgs[i].src = imgs[i].src+'?google'; } for (i=0; i<srcs.length; i++) { srcs[i].href = srcs[i].hr

Categories : Javascript

Tampermonkey's GM_xmlhttpRequest not implementing 'context' property?
Update: Tampermonkey now reports that this feature is fixed as of version 3.8.4116 (in beta at the moment). See: The bug report The change log Older/generic workaround: The context property is a relatively new feature of GM_xmlhttpRequest(), in Firefox. I doubt it's been implemented in Tampermonkey yet; see Tampermonkey's docs for GM_xmlhttpRequest(). Meanwhile, the tried-and-true method for this kind of thing is to use a closure. Change your GM_xmlhttpRequest() call to something like: ( function (flair_index, flair_text, encoded_name, profile_url, query_url) { GM_xmlhttpRequest ( { method: 'GET', url: xml_url, // Link to a steam profile with ?xml=1 added accept: 'text/xml', onreadystatechange: function (response) { if (response.

Categories : Javascript

Hiding content in Chrome settings using Tampermonkey
Update Support for Custom.css has been removed from Chrome in version 32. See this answer. User scripts can't access chrome: scheme. To hide 'Show' button in Chrome password manager, add this CSS code to User StyleSheetsCustom.css file in your profile folder. #password-manager .list-inline-button.custom-appearance { display: none; }

Categories : Javascript

Force Tampermonkey to run/execute script late
The content you want is being loaded by AJAX, so you need to use AJAX-compensation techniques in your script. The easiest way to do that is to use waitForKeyElements(). Something like: // ==UserScript== // @name _YOUR_SCRIPT_NAME // @include http://YOUR_SERVER.COM/YOUR_PATH/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @grant GM_addStyle // ==/UserScript== /*- The @grant directive is needed to work around a design change introduced in GM 1.0. It restores the sandbox. */ waitForKeyElements ( "jQUERY SELECTOR TO THE NODE(S) YOU WANT", changeFontColor ); function changeFontColor (jNode) { jNode.css ("color", "red"); }

Categories : Javascript

Get the line-number that throws the error in Tampermonkey?
The way I have my configurations, I see everything. Here is how: TamperMonkey Dashboard |> Settings Tab |> General |> Config mode: |> Select Advanced Debug scripts: |> Checked Logging level: |> Select Error (dealer's choice here, I chose this but you can decide)

Categories : Debugging

alert() doesn't show the value in a Tampermonkey script
Your alert alerts 'extern' because you alert it as a string. alert(extern) will alert the good value. And to make the div visible, just: document.getElementById('div2').style.display = 'block';

Categories : Javascript

Removing CSS Borders with javascript in greasemonkey/tampermonkey for facebook
border-right is a style property, not an element attribute, so removeAttribute won't work. Instead try this: document.getElementById("mainContainer").style.borderRight = "none"; (Note that border-right becomes borderRight for JavaScript, and make sure you spell names exactly.) However you might prefer user stylesheets. Browser extensions such as Stylish let you write CSS that is applied automatically, instead of going through script. (You can hide things using display: none, or mute them with opacity: 0.5.)

Categories : Javascript

Jenkins deploy plugin to deploy to multiple hosts on single tomcat
I received a strange email from someone asking me if I'd find the solution of this : The solution I used is : I wrote a post build script, which will delete the war from tomcat deployment folder and then it'll copy the built war from jenkins to that folder

Categories : Jenkins

Ant + Tomcat deploy "failed to create task or type deploy"
In addition to including the Tomcat classes in the Ant classpath, you need to define the "deploy" task to have Ant recognize it in the build.xml file, using the taskdef task (place it at the top of build.xml). Defining paths and properties inside build.xml is completely irrelevant to the classpath (when build.xml is processed the JVM is already running). Putting a folder in the classpath is likely useless (you need to include in the classpath the jar archives in that folder instead). Moreover, there's no guarantee that Ant cares for the CLASSPATH environment variable; you have to inspect, and possibly change, the Ant launch script.

Categories : Java

How to avoid the deploy of sources from Jenkins (to Nexus) in deploy phase?
Try adding : -Darguments="-Dsource.skip=true -Dmaven.javadoc.skip=true" to your maven release plugin config (Jenkins > your build configuration > Maven release build > Release goals and options

Categories : Maven

Change deploy location for solution published using web deploy
How about using the automatic backup capabilities in Web Deploy v3? http://www.iis.net/learn/publish/using-web-deploy/web-deploy-automatic-backups

Categories : Asp Net

Check war file before deploy / conditional deploy
Not sure what are the properties files you're referring to therefore I assume that you refer to typical java *.properties files. Anyway, I believe you should use: maven-enforcer-plugin and it's goal: enforce as that is the common way in maven to enforce some condition (the plugin uses term: rule) to be fulfilled. I think you have more options here. Option 1 Maybe you could check that prio to packaging to your war using: maven-property-plugin - goal: read-project-properties (http://mojo.codehaus.org/properties-maven-plugin/usage.html) <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> <version>1.0-alpha-2</version> <executions> <execution> <phase>???&

Categories : Eclipse

how to deploy your dart app (using Web ui) without using Pub Deploy
I wrote a Grunt script for it (since I had no time to look up how to properly write code for Grunt, I did not share the code since it's a mess) but I basically do this: compiling a list of files with dwc to a given out dir compile it to javascript clean up all non-deployable files change some paths inside the HTML to match the server paths (for some reasons, this gets changed by the compilation process) remove all packages except the ones I really need (JS interopt and browser) Since I'm only using the JS version, I remove all dart packages. Since the paths inside the HTML files are up to you, you can already use a structure that suits you/your server.

Categories : Dart

Restrict browser refresh, f5, browser back like banking sites through javascript/jquery
(1) No. There no possible cross-browser way to control browser functionality with javascript/jquery. (2) Banking sites do not restrict or control the browser functionality. They only ask users to desist. At most they attempt to detect some actions and then show errors. But, they don't try to control the browser. (3) This is a bad idea.

Categories : Javascript

Image looks terrible when viewed on a mobile browser, but perfectly fine on a web browser
You'll have to use a responsive layout to resize the image according to the screen size. Example of responsive layout rule: @media screen and (max-device-width: 480px) { .column { float: none; } } You can always search "responsive design" at any web search engine to get great references.

Categories : HTML

How to open links in default browser inside InApp Browser on PhoneGap
I have been using this as a workaround (opening an inappbrowser instance): // Image zoom $('#container').on('tap', '#content.cmscontent img', function() { var browser = window.open((navigator.userAgent.indexOf('Android') != -1 ? 'file:///android_asset/www/' : '') + encodeURI($(this).attr('src')), '_blank', 'location=no,toolbar=yes,enableViewportScale=yes,transitionstyle=crossdissolve'); }); See I added (navigator.userAgent.indexOf('Android') != -1 ? 'file:///android_asset/www/' : '') as a prefix before the url. Now it detects when you're app is on Android and adds the local URL in front of it.

Categories : Android

Browser requests file, server downloads pdf, browser displays pdf in iframe
Probably what you meant was simply: var uri = '/viewer/loaddrawing/'; document.getElementById('iframetitle').src = uri + '?key=' + value; There is no JSON involved, so the iframe will get a PDF directly. However, notice that the client must have a PDF-viewer plugin, otherwise the browser will ask for a download prompt.

Categories : Javascript

BlackBerry 10 browser submits form using browser submit button when using preventDefault
I have worked around this by adding action="javascript:void(0);" to you form (see updated fiddle http://jsfiddle.net/e4AHZ/11/). I do not know if this is good enough but action="javascript:void(0);" is in fact part of a solution given to a similar question. <form method="post" action="javascript:void(0);"> <input type="text" name="field1" value="some msg" /> <input type="text" name="field2" value="some msg" /> <input type="submit" /> </form>

Categories : Javascript

Problems while previewing image before upload on mobile browser, works fine on desktop browser
Modified another code snippet for it to work properly on browser. The code snippet, I modified is mentioned at the link below. Preview an image before it is uploaded Below is the code snippet which work properly on both desktop browser as well as mobile browser. <!DOCTYPE html> <html> <head> <title>File API- FileReader as Data URL</title> </head> <body> <input type='file' id="imgInp" /> <img id="myImage" src="#" alt="your image" /> </body> <script> function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { document.getElementById('myImage').src=e.target.result; } reader.readAsDataURL(inpu

Categories : Javascript

How to force to open a web page in external browser even if Popup Browser is enabled in Samsung Galaxy Note II
I don't understand your problem clearly but may this help you: Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse((String) i.getExtras().get("url"))); startActivity(browserIntent); where "url" is the URL to which you want to go in your browser. And i is an INTENT that holds the "url" from another activity. Can this help you?

Categories : Android

Need some plugin to use in selenium for browser compatable( for cross browser UI testing )
Selenium is a browser automation tool. It can only drive the browser by interacting with an HTML page loaded in the browser. There are currently no plugins (and as far as I'm aware nobody has any plans to make any) that you can add to Selenium to enable it to automate the OS level GUI.

Categories : Testing

Asp.Net: Retaining the old browser session after closing and reopening browser instance
You cannot reclaim the session-id as such, but you can certainly restore some of the predictable part of the session state. If you are using forms authentication, then just read the forms-auth cookie in global.asax session start and re-populate the session objects. You can control the expiration of forms-authentication cookie manually by creating a persistent cookie by using: FormsAuthentication.SetAuthCookie(userName, true) Alternatively, you can fine-tune the expiration by manually changing the cookie: Dim authCookie As HttpCookie = FormsAuthentication.GetAuthCookie(userName) Dim authTicket As FormsAuthenticationTicket = FormsAuthentication.Decrypt(authCookie.Value) Dim newAuthTicket As New FormsAuthenticationTicket(authTicket.Version, authTicket.Name, authTicket.IssueDate, expireDa

Categories : Asp Net

How to change and blink the title of the browser when the user goes to other tab or minimizes the browser?
For blinking the title: var title = document.title; var intv = window.setInterval(function () { document.title = document.title === '' ? title : ''; }, 500); // call this to stop the blinking function stopBlink() { window.clearInterval(intv); document.title = title; } As for doing it on tab switch or minimize, maybe running the code on window.onblur would work but I'm guessing it can't be done.

Categories : Javascript

This browser is not supported by Shopify While Authenticating Using Web Browser Control In Windows
Your question does not describe at all what you are trying to do and what problem you are trying to solve in doing so, so my only suggestion is: Don't use a Web Browser control, but use an HTTP client like HttpClient or HttpWebRequest and access their API. There's even have a .NET library for that.

Categories : C#

Child browser is not showing content of pdf in browser in android phonegap
The pdf will not get render as android webview does not support rendering pdf and the childbrowser uses android webview. Instead you can use some third party sdks for rendering in Android. Most of them require license(like quoppa,pdfViewer). I have not seen any opensource but you can look into the follwing link https://github.com/jblough/Android-Pdf-Viewer-Library For ios you can use pspdfkit.They are providing a cordova plugin also. go through the following link. https://github.com/PSPDFKit/PSPDFKit-Cordova

Categories : Android

Mobile Browser Compatibility: Site dont pinch in iOS browser
Try adding user-scalable=yes to your viewport meta tag <meta name="viewport" id="view" content="width=device-width minimum-scale=1, maximum-scale=1" /> to give you <meta name="viewport" id="view" content="width=device-width minimum-scale=1, maximum-scale=1", , user-scalable=no /> And I would move your Meta tage up near the top with the rest.

Categories : HTML

Cross-Browser compatible opening of a new tab/window (browser)
You have to manipulate the target like Joum saved in the comment section. Or you simple are using the posible to return false;. <a class='popup' href='www.websitename.com'>website</a> $('a.popup').live('click', function(){ newwindow=window.open($(this).attr('href'),'','height=200,width=150'); if (window.focus) {newwindow.focus()} return false; });

Categories : Javascript

bash script openning firefox browser from browser
Make sure you're running your script on a terminal under same user and same X session. The DISPLAY variable should be set. Add this line to know more info: ... echo "DISPLAY: "$DISPLAY", whoami: $(whoami)" /usr/bin/firefox http://www.google.fr ## No need to add &. Your user should be the same as the one on your X session. If DISPLAY has no value, try setting to :0.0 as a quick hack: ... export DISPLAY=':0.0' /usr/bin/firefox http://www.google.fr If it still doesn't work, try to refer to some threads about DISPLAY like here.

Categories : Linux

How can I start a tor browser from the vidalia panel using the tor browser bundle?
I found this Link: http://askubuntu.com/questions/217092/restart-tor-browser-after-closing Maybe there is no solution at the moment.

Categories : Linux

launch an application from browser with parameters (cross browser)
You can use the following: <a href="c:windowsNotepad.exe" type="application/octet-stream">Launch Notepad</a> From what I remember using file:// is blocked by Chrome and Firefox. I don't know how to send parameters but at least you can launch an application without using an ActiveXObject.

Categories : Javascript

Does the IE 10 browser have a shorter internal timeout than the Chrome browser?
Relying on these kinds of wait periods is unwise, because they can change with each new version. Why not have one call start the compression and have the browser poll the server after every 15s (or whate ever value) to see if compression is complete. When compression is complete then begin streaming. This pattern is quite easy to implement in JavaScript and on ASP.NET as well.

Categories : Asp Net

Out-of-browser specific settings do not affect in-browser applications
I am the guy who upvoted your question as I had a similar problem. The solution was so simple I could hardly believe it when I found out. Syntax error in my XAML. I declared FontSize="20px" instead of FontSize="20". Duh.

Categories : Windows Phone 8

Differentiating between browser tabs and browser windows in C#
Your goal, if I understand correctly, is to identify if a page you've loaded/launched is tabbed or if it launched in a new browser window. It's agreed that a tabbed browser window is indistinguishable from a standalone browser window. I’ve got a solution for you – admittedly it’s not terribly elegant but it should do the trick. Imporant: You can switch between tabbed windows using Ctrl+Tab and Ctrl+Shift+Tab. Launch the page in question Start your coded-ui recording If your page is tabbed, press Ctrl+Shift+Tab and this will take you to the parent page, or whichever other page you’re tabbed with. Create an assertion to verify that you’re on that page. Press Ctrl+Tab, and now you should be back on the new page you're testing. Create an assertion to verify that you’re on that n

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.