Link to home
Start Free TrialLog in
Avatar of becraig
becraigFlag for United States of America

asked on

Chrome extension script injection

I need to figure out how to inject a script into a webpage via a Chrome extension.

I am able easily to use document.write / writeline but it seems to just sit there and do nothing I am sure I am doing something wrong and just too lazy to look for the right approach.

document.writeln('<Script>var prevent_bust = 0;window.onbeforeunload = function() {prevent_bust++}setInterval(function() {  if (prevent_bust > 0) {prevent_bust -= 2; window.top.location = "https://httpstat.us/204"}}, 1); </script>');
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial