Force installing untrusted Safari extensions
Copied from: Safari 9 - I cannot install extensions 

To install a .safariextz file, go to:


System Preferences > Keyboard > Shortcuts > Keyboard
  (for OS X 10.11.4+)


or


System Preferences > Keyboard > Shortcuts > Full Keyboard Access
  (for OS X 10.11.1 to 10.11.3)


Then at the bottom of that dialog box, change the Full Keyboard Access:... option from Text boxes and lists only to All controls. You can then dismiss that System Preferences window.

Then, return to installing the extension. Double click your Safari Extension file and when the "Are you sure you want to install..." dialog box appears, do not click on the Trust button. Instead, use tab to select the Trust button and then confirm by hitting space. That should install the extension as required.