0

I am exporting strings from one webpage to another on a different domain. I am using GM_setValue and GM_getValue to transfer the data between the windows.

I currently have a button on each site, one for exporting the data and the other for importing the data. I was hoping to get this down to one button with an event listener for a GM object value being changed.
I was looking at Object.Watch as a potential solution.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295

1 Answers1

0

Only Tampermonkey provides GM_addValueChangeListener. With all other userscript managers (according to the feature comparison table as of Nov 24, 2014) you'll have to use timer-based approach via setInterval because Object.watch won't work due to the absence of an object per se as GM_getValue returns a value, not a reference.

wOxxOm
  • 65,848
  • 11
  • 132
  • 136