Opening New Windows in Chrome - javascript

At my workplace, there is a website we regularly visit to obtain some information. Upon clicking a link in the page, a new window opens and displays the information. This currently works fine in IE8+, but the link is dead in chrome. I've checked and after researching, I believe that chrome is blocking from a new window to open due to security measures. I get no warnings or pop ups, JavaScript is enabled, pop up is allowed for all sites, so now I'm a bit stuck. Is there a built in command to access the chrome features and enable to open new windows? We are using chrome mostly and would like to resolve on this browser. The onclick script looks like this:
onclick="javascript:OpenW('ViewInvoiceEstimate.asp?EIID=2984252&EI=I&Tabname=OPEN')
When I attached the link section of the script as the suffix to the web address, the content shows up fine from the same web browser.

Related

Open Android "real" browser when link clicked in embedded/system browser with JavaScript

I'm driving traffic to a landing page with PPC on Twitter. Naturally, when they click on the ad in the Twitter app, it opens "embedded" in Twitter, which is usually WebView, but sometimes some vendor specific browser such as MIUI.
The issue I have is that 1/3rd+ of my traffic is running on Android 10 or earlier, and the Stripe code doesn't work in WebView (but it does work in Chrome on the same devices). So, what I'd like is to write a little bit of JavaScript that detects the OS version, and whether it's one of these system webview browsers instead of the "real" browser, and then insert something like:
"Unfortunately, this browser doesn't support payments. Please open this page in your phone's browser, or click this link".
Where the "click this link" link opens the same page in the "real" browser. Of course, I could just have the rest of the text without the link, but it seems like a better UX to me this way, if it's possible.
There's a similar question from 2015 that indicates it's possible in Java, but I'm not writing an app, this is just a web page, so I'm wondering if it's possible/how to do it in JavaScript.

Selenium Chrome Driver opens a different page than regular Chrome Browser

I'm trying to pull some information from this URL and ones like it: "https://www.rockymountainatvmc.com/tires-and-wheels/tusk-impact-complete-wheel-rear-p?s=1033997&v=1216"
My goal is to get the MSRP and other info for a specific part. To do this, I'm using python to run a selenium chrome webdriver that opens several of these URLs. The problem is the links aren't opening with the same information that I would get in my regular Chrome browser.
The link is supposed to contain all the information to "select a vehicle" and thus a specific part. When I open this in my regular chrome browser, everything works fine. When I open this using the automated Chrome page, it fails to select a vehicle and shows a general part page.
I can't figure out what the difference might be between these two browsers that would cause this. My regular chrome browser and the chromedriver are both version 81.0.4044.113. I've tried going to whatismybrowser.com and all settings are identical. Another interesting thing is opening this in internet explorer gives me the same result as the automated chrome browser. Help!
regular chrome browser
automated chrome browser
The Regular chrome browser is fetching the details of your bike(Something -- yamaha 125). It could be from past cookies or cache.
However, once you are opening it with Automation, a clean session s opened.
Try cleaning your cookies and cache on the browser(regular) and then try, both of them should appear same.
Or you can use options in chrome to select the profile your regular chrome browser is using. See https://startingwithseleniumwebdriver.blogspot.com/2015/07/working-with-chrome-profile-with.html.
Hope it Helps!

Is there any way to force a link to open in Chrome from Facebook's in-app browser?

I've got a web app that requires the ability to print. Facebook's in-app implementation of Chrome doesn't allow printing. Currently, I'm giving the user instructions on how to open in chrome themselves in place of the print button I give normal users. But I'd prefer to just open Chrome for them when they get to that page, or at the very least provide a button/link that would open the page in Chrome instead of forcing them to find the settings button and figure out how to open Chrome themselves.
I've tried using the googlechrome://myurl.com approach, and Chrome opens, but the specified url doesn't load.
I've looked into Google's Intent option but I wasn't able to figure out how to open Chrome with that method.
Is there a way to accomplish this in javascript? or by some url scheme in an href attribute?
So far, all the other answers I've found give explanations for how to do this from an Android App, but not from a website.
** Update: The googlechrome://myurl.com seems to work fine from iOS in the native facebook app. It does not appear to work correctly using the native facebook app in Android.
Try
googlechrome://navigate?url=example.com
for Android users.
Reference from https://stackoverflow.com/a/12013755/9514189

Google+ JavaScript API Login Popup not returning Chrome on iOS

I am using the Google+ Javascript API log in button and it works perfectly fine in Chrome on Windows and Android. It also works perfectly fine in Safari on an iPad and iPhone. However, when using Chrome on the iPad or iPhone, the pop-up tab for the Google log in never returns after clicking to allow access. It seems to be submitting the form to the pop-up tab and never directing back to the original tab. Any ideas?
Google knows about this issue, but currently cannot do anything about it. It comes down to window.open not working in UIWebview.
Safari is not limited by App Store rules the way all third-party apps
are. Apple can use any WebKit APIs they want to, whereas we are
constrained to what is possible using UIWebView.
They encourage anyone facing this issue to open a bug with Apple.
You can't make Apple do anything, but anyone affected by this can
file a bug against Apple about the fact that UIWebView doesn't support
window.open and subsequent cross-site scripting, to clearly
communicate demand for that support.
There's no way for people to add votes or comments to existing Apple
bug reports, so the usual advice is for everyone to file their own.
Here's the URL for bug reporting in Apple: https://bugreport.apple.com
Here is a sample bug posting to Apple provided by one of the users:
Summary: Please add support for window.open and subsequent cross-site
scripting to UIWebView. This is blocking Facebook/Twitter/etc login
workflows in Chrome for iOS for example
Steps to Reproduce:
1. In a tab, open a page that runs the code var w = window.open(yourURL, null, null);
2. The page at yourURL should try to accesswindow.opener`, such as to postMessage back to the original page
3. Don't profit.
Expected Results: New window can access window.opener.
Actual Results: window.opener is undefined.
Version:
7.0.4
Notes:
Configuration: Chrome Version (from "Settings > About Google Chrome"):
19.0.1084.60 Device Type: iPad 3
You can follow the issue thread for updates.

Bookmarklet Opens Empty Window

Ok so I have a basic bookmarklet that opens remote websites. However when I try to open my local dev site it just opens to a blank page. I am assuming this has something to do with security etc.
I set the bookmarklet to open one of my remote sites, gnull.com - This worked fine. I then set gnull.com to resolve to 127.0.0.1 and changed my bindings in IIS. The result this time is that a new window opens however it is blank. When I look at the headers being sent only one is created with a result of 'error' and a type of 'NS_ERROR_ABORT'.
I am using Firefox 4 on Windows 7. Does anyone know how to setup bookmarklets for testing local sites? The code itself works fine since I have tested this with other live websites so this appears to be a browser security feature.
So as I mentioned in the comment, I found the issue was with ABE - a component of the noscript extension. ABE blocks scripts from accessing local resources, in my case a local website. I disabled ABE in the noscript options and everything works fine.

Categories