browser

how to get current URL from Browser in API 23?

≯℡__Kan透↙ 提交于 2020-01-01 07:19:05
问题 how to get current URL from Browser in API 23. I tried to use Browser.BookmarkColumns, but it was removed from API 23. thanks in advance public String chromeHistory(){ String[] proj = new String[]{"title","url"}; Uri uriCustom = Uri.parse("content://com.android.chrome.browser/bookmarks"); String sel = "bookmark = 0"; Cursor mCur = getContentResolver().query(uriCustom, proj, sel, null, "date"+" ASC"); String url = ""; if (mCur.moveToFirst()){ do{ url = mCur.getString(mCur.getColumnIndex("url")

Android: Download file directly from browser

寵の児 提交于 2020-01-01 06:39:33
问题 I'm trying to make the android browser download a file of a specific type '.xxx’ say, so that I can then set an app to be associated with it. I've successfully done the association part, in that I've made it so that clicking on a file of the right type in an explorer app loads the appropriate app. I expected this to carry over to the browser so that if I attempted to download a file type .xxx then it would open the app. This doesn’t happen, all that happens is that the text contained in the

Sending simulated click via WebBrowser in C# to flash object embedded in HTML

ぃ、小莉子 提交于 2020-01-01 05:43:07
问题 I have not been able to find a way to send a simulated click to a flash .SWF application on a site I'm visiting using the WebBrowser control in WinForms. Though I've read countless posts on the subject, there seems to not be much information floating around on the internet. The only resources I've found here that technically provide answers for my question are: Reading Packets - This link recommends reading the packets sent from the flash application and might be my only working solution.

What external resources are loaded when window.onload event is fired and what is the loading order of the resources?

a 夏天 提交于 2020-01-01 05:07:05
问题 Since a single web page may contain lots of external resource: external javascript, external css, images, applets, flash, etc., usually my conventional wisdom tells me that the window.onload event is fired when all the linked resources are finished downloading(though the external resources are usually downloaded in multiple threads or processes by the browser's implementation). The usual case may work in most of the time. But...what if the loading sequence is not what I take it for granted,

Which key does the e.metaKey refer to in JavaScript MouseEvent?

偶尔善良 提交于 2020-01-01 04:20:13
问题 MouseEvent.metaKey doesn't seem to work. On both FireFox and Chrome, it returns false even if I hold the Win key while clicking: <!doctype html> <button onclick=alert(event.metaKey)>click while holding "meta key"</button> MDN states: The MouseEvent.metaKey read-only property returning a Boolean that indicates if the Meta key was pressed ( true ) or not ( false ) when the event occured. Note: On Macintosh keyboards, this is the command key ( ⌘ ). On Windows keyboards, this is the windows key (

Feature detect opening in a new window/tab(target=_blank) with JavaScript

情到浓时终转凉″ 提交于 2020-01-01 04:09:29
问题 According to my research: "WebView" can disable "opening links in new windows/tabs". WebView is used by native app developers to display webpages within their app(see Twitter's app). Detecting WebView via user agent doesn't work consistently and isn't a best practice anyway. Simply attempting to open a new window with JS triggers popup blockers; making it an unreliable way to test if a new window can be opened. I need to detect when this feature is not available. Impossible? Additional

batch file to open tabs in a NEW browser window

前提是你 提交于 2020-01-01 02:29:12
问题 I need to modify batch file. I have a batch file that opens many tabs when I click icon from desktop. These tabs are opened in my ALREADY OPENED default browser. I would like to have a NEW WINDOW open for these tabs. The batch file looks like this: @echo off start "webpage name" "http://someurl.com/" start "webpage name" "http://someurl.com/" start "webpage name" "http://someurl.com/" start "webpage name" "http://someurl.com/" What changes do I need to make 回答1: I figured this out. The batch

View javascript events in browser

こ雲淡風輕ζ 提交于 2020-01-01 02:17:55
问题 I'm using Firefox. Is there something out there that will show me all the JavaScript events that are getting triggered in real time? 回答1: You can right-click an element in Firebug's HTML tab and click Log Events. You will then see every event received by that element in the Console tab. You can even click one of them to explore the properties of the event object. 回答2: I have been using Visual Event for a few years now. It's a simple bookmarklet, meaning you just have to drag it into your

Protractor instance vs browser

假如想象 提交于 2020-01-01 01:12:06
问题 I have tried to looked up for similar QA's but i couldn't find one to satisfy me. So basically i saw that in some examples it's used ptor = protractor.getInstance(); ptor.get(url); And in some other examples it's used. browser.get(url); So th question is: What's the difference using protractor instance and browser for getting specific url? Also if my assumption in the P.S. is right, which is better practice: to use only protractor, or to mix them? P.S. Also i saw same difference in usage with

Automatically run JavaScript code upon loading a specific website

北城余情 提交于 2019-12-31 22:27:53
问题 I've written scripts to filter out threads and posts in a programming forum by author. But you need to post the code into the web console for each page individually. I was wondering if it were possible and if so how (using either firefox or chrome), to set your browser up to run a specific script upon loading a specific site? Is it possible as an extension or plugin? 回答1: You can use Tampermonkey for Google Chrome Tampermonkey is the most popular userscript manager for Google Chrome.