I have this regexp constructed pattern I’m passing a string variable to. This works perfectly in Chrome, but won’t work in Safari. Is there a way I might be able to convert this code to be compatible across browsers? Thank you! Answer You can use The (?!Bw) negative lookahead requires a word bound…
Tag: cross-browser
Javascript – What is alternative to find function?
I am using find () function for one of my project. Official document https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find says that Internet Explorer is not supported. What else can I use? Answer A polyfill is a code that provides the functionality that you normally expe…
How to manipulate webRequest cookie in a cross-browser extension?
I am trying to edit cookie for all API calls using webRequest from a cross-browser (supporting chrome and Firefox) extension which I am creating. Following is the code: Problem: In Chrome, the code works with extraHeaders and in Firefox the same code works only if extraHeaders is removed. How can I make it wo…
Are there any browser-native 360 spin viewers?
There are several plugins for viewing interactive 360-spin images of products, such as this: https://www.ajax-zoom.com/index.php?cid=home&tag=spin360 However, my question is whether there are any current or proposed solutions for this that are browser-native, so don’t require any plugins? One analog…
Are tags subject to the same CORS restrictions as javascript/fetch calls?
It’s common practice to include scripts from other origins with script tags but when you use fetch calls on other origins then everything must be configured carefully other wise you will get a CORS error. Does the script tag somehow bypass CORS? How does that work? Answer The Same Origin Policy prevents…
setTimeout function not working on firefox
I am trying to use <input type=”submit” name=”add” class=”buy” onClick=”setTimeout(‘history.go(0);’,2000);”/> It reloads the page on click after two seconds in chrome but it doesnt work in Firefox. I went through this Why does window.location.r…
Going back to previous page using javascript
Is using JavaScript the most efficient way of navigating back to the previous page when a link or button is clicked? What if JavaScript is disabled on the user’s end (Which most people don’t)? Are there any known issues with cross-browsers? Are there any browsers that don’t support the histo…
Getting a browser’s name client-side
Is there any object or method that returns data about the browser, client-side? For example, I need to detect if the browser is IE (Interner Explorer). Following is the code snippet. Is there a better way? Answer EDIT: Since the answer is not valid with newer versions of jquery As jQuery.browser is deprecated…
Calling a .dll function from a html page that runs on chrome and firefox
I have a dll written in c++. now i need to call the functions in the dll from a html page. I have done this by calling the dll in vbscript (Activex) so that i can run the only in IE. Now i need to run this on Chrome as well as Firefox. What i have to do, whether i
“google is not defined” when using Google Maps V3 in Firefox remotely
Here’s my conundrum: I have a page that uses Google Maps V3 and jQuery. It all worked well locally in FF5, Chrome and Safari. Once I uploaded to a web site, I get a “google is not defined” error on the first line that I try to use a google object It only occurs in FF and only occurs remotely