0

I want to create a Tampermoney script that writes something in an input field, if it finds a string on the page. E.g:

If the page contain the string "life is", the script should automatically append "good".

(I want to make this with word detection, so the string "life is", will appear on the page after that the page was accessed)

MikeyJY
  • 41
  • 2
  • 2
  • 7

1 Answers1

1

First you need to get the body as String and the input you want to modify

<input id='input-id' />

const page = document.body.innerHTML
const input = document.getElementById('input-id')

Then check if the value you want is in the page

if(page.search('life is') !== -1)
   input.value = 'life is good'
Douglas
  • 381
  • 4
  • 12