Click here to Skip to main content
15,741,752 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello, coding guys,

As you saw in the title, my cursor is not changing in iframe. This is the function in the script that adds the specific cursor in my iframe:

function addDefaultToIframes() {
	try {
		globalStyle = document.createElement("style")
		globalStyle.innerText = "* {cursor: url(, url(, default !important;} *:not(input, *[contenteditable='true']) {user-select: none;}"
		document.getElementById("appFrame").contentWindow.document.onload = function() {
			document.getElementById("appFrame").contentWindow.document.querySelector("*").style.cursor = "url(, url(, default !important;"
			document.getElementById("appFrame").contentWindow.document.querySelector("*:not(input, *[contenteditable='true'])").style.userSelect = "none"
		setTimeout(function() {addDefaultToIframes()}, 1)
	} catch (err) {
		console.log("Captured error: " + err.toString())

I don't know why is the pre acting weird

And, it doesn't result in a change nor an error.

What I have tried:


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900