I have this javascript bookmarklet This appends the prompted value to www.oracle.com and opens that url in tab.
javascript:window.location.href='http://www.oracle.com/'+prompt("Please enter your input:", "exadata");
In firefox, this works fine. If I have some open tab with some website, clicking on this bookmark, open the expected site. oracle.com appended with value filled. This also works when I am in new tab and opens oracle url as expected.
But in chrome, this works fine if I have some site loaded in tab and click on this bookmark. But if I am in new tab page, clicking on this bookmark does nothing. It does not even show prompt box.
What I am missing here? Is it something related to how new tab page is handled in firefox and chrome?
This seems due to some issue with disabling of javascript on new tab page due to security reasons.
More details can be seen here : https://bugs.chromium.org/p/chromium/issues/detail?id=98871#c2
From comments on above issue, I found same can be achieved as below if we treat it as data url (https://bugs.chromium.org/p/chromium/issues/detail?id=98871#c7) :
data:text/html,<script>window.location.href='http://www.oracle.com/'+prompt("Please enter your input:", "exadata");</script>
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With