skip to Main Content

Javascript – can a js URL object be a long number?

new URL(`http://12345678901`) is not valid but new URL(`http://1234567890`) and new URL(`http://a12345678901`) are. these work: console.log(new URL(`http://1234567890`)) console.log(new URL(`http://a12345678901`)) This does not: console.log(new URL(`http://12345678901`)) Here's the error in chrome: VM2064:1 Uncaught TypeError: Failed to construct 'URL': Invalid URL at :1:1 (anonymous)…

VIEW QUESTION

Javascript – First Firefox extension test not going well

I am writing a first test of a firefox extension. I am using the following websites as assistance: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Context_menu_items https://github.com/mdn/webextensions-examples/blob/main/menu-demo/background.js Here is my code: mainfest.json { "manifest_version":2, "version":"1.0", "name":"Test", "content_scripts":[ { "matches":["<all_urls>"], "js":["main.js"] } ], "permissions":["contextMenus"] } main.js alert("test");…

VIEW QUESTION

jQuery find a li element within ul

I've a function, which should remove a li element from a list identified by the id. I use jQuery and this call $("#selector").find("li[id='" + id.substring(4) + "']").remove(); The call started with a click on a button. In Firefox it works…

VIEW QUESTION
Back To Top
Search