TDX creates a new window whenever you click a new Ticket/User/etc. This script, paired with “Stay for Safari,” blocks the new window from appearing and instead opens it within the current window in a modal container.
Key features include:
- Overriding
openWin
to display content in a modal overlay. - Removing
openWinHref
onclick attributes dynamically. - Compatibility with Safari using the Stay for Safari extension.
How to Install script.js
on Safari Using Stay for Safari
Prerequisites
- macOS with Safari installed
- Stay for Safari extension installed from the App Store
script.js
file ready for installation
Steps
1. Install Stay for Safari
- Open the Stay for Safari page on the App Store.
- Click on the “Get” button to download and install the extension.
- Once installed, open Safari and go to
Preferences
>Extensions
. - Enable the Stay for Safari extension.
2. Open Stay for Safari
- Click on the Stay for Safari icon in the Safari toolbar.
- Select “Manage Scripts” from the dropdown menu.
3. Add script.js
- In the Stay for Safari interface, click on the “+” button to add a new script.
- Enter a name for your script (e.g.,
My Custom Script
). - Copy the contents of the
script.js
file found here and paste it into the script editor. - Specify the TDX URL in the 6th line of the script.
4. Save and Activate the Script
- Click the “Save” button to save your script.
- Ensure that the script is enabled by checking the toggle switch next to the script name.
5. Verify the Script
- Navigate to a website where your script should run.
- Open the browser console (Option + Command + C) to verify that the script is executing correctly.
Conclusion
You have successfully installed and activated script.js
on Safari using the Stay for Safari extension. You can now enjoy the custom functionality provided by your script on the specified websites.