How to replace javascript variables with greasemonkey? [on hold]

23
February 11, 2019, at 8:10 PM

I want to change a variable in javascript with greasemonkey... I want the alert '4321' on the page with greasemonkey script. but when I run the page it gives 1234 alert.

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  replace in javascript!
// @author       Ben
// @match        *://*/*
// @run-at       document-start
// ==/UserScript==
(function() {
    'use strict';
  var str = document.getElementById('script').innerHTML;
  var res = str.replace("1234", "4321");
  document.getElementById('script').innerHTML = res;
})();

HTML

<html>
<head>
<script>
    var degisken = '1234';
    alert(degisken);
</script>
</head>...
READ ALSO
Nodemon not working after updating to version 1.18.10

Nodemon not working after updating to version 1.18.10

nodemon was working perfectly in my mac previously, I updated it to the latest version and when I try to start it, I keep getting the below error

14
ngx-pagination - rendering page very slow

ngx-pagination - rendering page very slow

I am trying to build an application using Nodejs, Angular 6 and SQLIn my database I have more than 80

10
problem with socket programming on my host

problem with socket programming on my host

i wanted to use a website to send some commands to a client app but in my host i can just access to ports 80 and 443 is it possible that i make socket programming with these ports?

39
how to print sum of primes in a list in python?

how to print sum of primes in a list in python?

How do I print sum of primes in a list in Python?

30