Search code examples
javascriptpluginssafariblock

why plugin blocked by Safari?


My plugin almost works fine in Safari for Mac, but sometimes it is blocked by Safari(see at Safari - Preferences - Security - Manage website setttings).

so my first question is how can I let my plugin be a "Allow Always" plugin in Safari without user's operation?

And when plugin is blocked, Safari will display a placeholder instead of the Internet plugin content. look here

so the second question is when Safari block my plugin(maybe user choosed), how to know it by JS?


Solution

  • Your comments above made it more clear what you were trying to accomplish. It has already been established that if your plugin is blocked than no code inside your plugin will be executed (for security reasons) but it is possible to let your website know if the plugin was loaded (or not loaded) using injected scripts. Here is an example on the Apple developer page showing how an injected script can access a JavaScript function.

    In this document you will find everything you need to know about access and restrictions for your plugins and extensions

    And this document will help you understand messaging and proxying between different components of your plugin and the website.