Chrome does not seem to allow for window.print() - javascript

I've been trying to get a simple "print" link on my recent page to work. I set up a simple fiddle to show what I'm trying to do.
http://jsfiddle.net/bladnman/4Ux9U/
For some reason Chrome is complaining about:
TypeError: Property 'print' of object [object Window] is not a function
You know, this very very simple kind of thing. Been doing it for years:
Click me to Print
UPDATE #1:
Many users have reported that this is working fine for them on Chrome. I still see nothing but the error reported.
I did want to add my environment:
Version: 21.0.1180.89
OS: OSX Mountain Lion
UPDATE #2:
Big thanks to Arjen! It turns out that an extension (Better Popup Blocker) changed the DOM enough as to null out the "print" function on Window.
Thanks again everyone!

I didn't have any issues with it, but I was able to reproduce the problem you were having on Windows 7 running Chrome 21.0.1180.89 by enabling my popup blocker (I use Better Popup Blocker - Chrome Web Store) for jsfiddle.
If you are using a popup blocker, try disabling it for jsfiddle / the site you are working with.

The Adblocker chrome extension in Mojave stops window.print() as well.

Related

Google Invisible reCAPTCHA breaks Firefox JavaScript

I have tried pretty much every which way to configure the Google Invisible reCAPTCHA widget, but there is always an issue with the latest Firefox browser, detailed as follows:
add the plugin to a web page, which has other JS such as a dropdown menu
load the web page
keep loading the web page over and over, in an attempt to catch it 'half loaded'
eventually you will see for a split second an alert "The page at https://www.google.com says: Cannot contact reCAPTCHA. Check your connection and try again"
from now on, JavaScript is entirely broken until you restart the Firefox window
This never happens in Chrome, and appears to be Firefox only. I am surprised to not find any reports of this major issue with vendors Google and Firefox (unsure which party is to blame), so created this ticket.
This issue can be replicated on the official Google Invisible reCAPTCHA Demo by quickly reloading the page. This will eventually show the alert and break the entire demo, making all form inputs unresponsive until the Firefox window is closed and re-opened.
At the time of writing, I am using OSX Firefox 57.0.1 (64-bit) to replicate this issue, but has also been replicated on the same Firefox under Windows 10.
Update after valid comment from Federico, as this is being reported a lot but no solutions or workarounds that I can find: Google Groups Search
Is this a known issue and are there any plans to resolve from either Firefox or Google, or more importantly has anybody managed to put a workaround in place in the meantime?
I think the issue is resolved now. Try again and it is giving successful verification. I guess it was a bug which they fixed. If the problem still persists please try upgrading Firefox to the latest version.

Chrome JavaScript turned off

Okay, here's my problem. I wrote some JavaScript for a page, for some reason the page doesn't work in Chrome. The site does what I expect in Opera, Chromium and Firefox. In the Choom devtools there is a kind of error showing in the source tab showing "JavScript is disabled" in a mouse hover popup:
I turned off all chrome's extensions, Javascript in on in the content settings and I cleared all JavaScript exceptions I had, but this didn't seem to change anything. The weird thing (an other one) is that some other sites give the same alert icon in the devtools (including this one) but JavaScript works just fine.
If you perform the exact same functions in the console then, some of, the functions perform just fine.
Does anyone have an idea what I could be because I am out of idea's and it is really annoying that I have to switch browser to test the page (page is 'live' here). Thanks
Have you checked the DevTools settings? You might have accidentally enabled "Disable Javascript"

Change the context of the Safari 6 console to an iframe on the page

I know that Chrome let's you pick the context for the console's execution with a dropdown menu and that Firebug let's you cd() into an iframe. I can't figure out how to change the context in Safari's console. Does anyone know how to do this?
Safari, unlike chrome and firefox, has no real support for this functionality and the only option seems to be to access the window object from the console. As you correctly point this will trigger cross domain policy issues, however provided you're running on mac (this does not work for some reason on windows) you can use
open -a '/Applications/Safari.app' --args --disable-web-security
to bypass this. And next on your jsbin you could use something along the lines of
window.frames[0]
to access the window of the page. As far as I can see there is no similar solution for windows, as
Safari.exe --disable-web-security
apparantly does not work.
The Iframe element itself is of Type Window within Console
<iframe id="frame" src="about:blank"/>
In Safari console then you simply work with
frame.document.write('bla');
please notice that 'frame' is shorthand for document.getElementById('frame')

Javascript, Losing console.log between url posts

I am trying to watch my javascript code using the console.log(text) command - and it does work... but the console gets flushed everytime the url changes.
Is there any way to persist my console logs between page changes?
Click on the bottom-right corner gear icon in the Chrome developers tool, check 'Preserve log upon navigation' option and you are done.
For the record, these days both Firefox and Chrome have 'persist' options in their inspectors / conosole. You need to right click in the console window and then select the relevant option tfrom the popup menu.
There isn't a way to do this yet but from what I've read it is a future feature they will implement. Here is the Issue ticket on it: http://code.google.com/p/chromium/issues/detail?id=77058
EDIT:
Chrome has implemented this feature. Read the answer below
There's only 1 way that I know of, but not with Chrome: With the built-in Web Inspector in Firefox 4+, which doesn't flush the logs between pages.
#scrappedcola notes that Firebug does this as well, but I'm referring to the built-in inspector.

Opening modal dialog window is not working in Chrome

Response To:
Opening Popup Window is not working in firefox and google chrome
Hi,I have similar code in above question.My code works fine in IE.
this.parent.window.showModalDialog('Counter.aspx', '',
'dialogHeight:170px;dialogWidth:150px;status:no;scroll:no;edge:sunken;toolbar:0;center:on;help:off;unadorned:yes;');
What can i do about this code in order to open this window in Google Chrome browser ?
Thanks for any assistance
Myra
showModalDialog works in chrome(its not truly modal though). the problem could be that it is blocking them. Chrome's minimalistic design doesnt even tell you that some times. try adding an exception for you current website.
you can find it under -
Options->Under The Hood Tab-> Content Settings Button -> Popups Tab -> Exceptions button

Categories