... at fixing the script path detection. should hopefully fix https://github.com/ghacksuserjs/ghacks-user.js/issues/264#issuecomment-346891526
this should now work no matter how the script is called (including symlinks) on both Mac and Linux. + Storing and restoring the original working directory to prevent problems in certain circumstances.
thanks @overdodactyl !!