|
|
Line 632: |
Line 632: |
| * Author: Mike Morearty (Adobe) | | * Author: Mike Morearty (Adobe) |
| * Contributors: | | * Contributors: |
| | thelauralee |
|
| |
|
| == New value for <code>NPN_SetValue()</code> ==
| | Laura Lee McCree |
| | a broken link which plugged itself into the mozilla wiki system. |
|
| |
|
| I am proposing a new value that can be passed to <code>NPN_SetValue()</code>:
| | Sheer isolation of said plugin [stereotyped to be a typical hangar] caused reverse isolationism effects to affect said plugin user. |
|
| |
|
| NPPVpluginPushDisableHangMonitorBool
| | User error. Recount. |
|
| |
|
| This value would be recognized by <code>NPN_SetValue()</code>, but not by <code>NPN_GetValue()</code>.
| | === Example === |
|
| |
|
| The browser would expect a value of <code>true</code> or <code>false</code> to be associated with this value:
| | everywhere you look. |
| | |
| | == Browser-specific behavior == |
| | |
| | define terms. check spelling. try harder. do better. |
| | |
| | MAKE |
| | |
| | BETTER |
| | |
| | CHOICES |
|
| |
|
| * When the plugin passes <code>true</code>, it is telling the browser, "Push the state of your plugin hang monitor, and then disable the plugin hang monitor."
| |
| * When the plugin passes <code>false</code>, it is telling the browser, "Pop the previous state of the plugin hang monitor."
| |
|
| |
|
| === Example ===
| |
|
| |
|
| Here is an example of how a plugin would typically use <code>NPPVpluginPushDisableHangMonitorBool</code>. Let's say the plugin has connected over a socket to a plugin-specific debugger, and has hit a breakpoint. It is blocked, waiting for the user to issue some sort of "resume" command. The plugin's code might look like this:
| |
|
| |
|
| NPN_SetValue(instance, NPPVpluginPushDisableHangMonitorBool, (void*)true);
| | and love freely or not at all. |
| processSocketMessages();
| |
| NPN_SetValue(instance, NPPVpluginPushDisableHangMonitorBool, (void*)false);
| |
|
| |
|
| == Backward compatibility ==
| |
|
| |
|
| The behavior of <code>NPN_SetValue()</code> is that if it does not recognize the variable that was passed in, it returns an error code such as <code>NPERR_INVALID_PARAM</code>, but it does not otherwise interfere with the operation of the plugin. So, a plugin would be free to pass this value to an older browser, and be confident that if the older browser did not recognize this parameter, the result would be essentially a no-op.
| |
|
| |
|
| == Browser-specific behavior ==
| | your half-hearted sentimentalistic bullshit is worth almost as much as pop psychology in this new day and age. |
|
| |
|
| Not all browsers have any sort of plugin hang monitor, and of those that do, there may be variations in their behavior. There are a few ways in which the behavior of <code>NPPVpluginPushDisableHangMonitorBool</code> may vary slightly from one browser to the next:
| | Get big or go home. |
|
| |
|
| * As described above, if an older browser does not recognize this variable, it would return an error code.
| | GROW A PAIR already. |
| * A newer browser might recognize this variable, but might not have a hang monitor. In that case, the browser would ideally return <code>NPERR_NO_ERROR</code>. However, it is common practice for plugins to return error codes for any variable that they don't explicitly handle. Therefore, plugin authors would be wise to code defensively, and not assume a particular return value.
| |
| * When a plugin passes <code>true</code>, it is really only requesting that the plugin monitor be disabled for ''that one instance'' of ''that one plugin.'' However, due to implementation issues, it may be difficult for some browsers to have such fine-grained control over their plugin hang monitor, so a browser is free to respond more broadly, such as by disabling its plugin monitor for all instances of that plugin, or disabling its plugin monitor for all plugins in that web page, or disabling its plugin monitor entirely.
| |
| * When the plugin passes <code>false</code>, browsers may differ in how they restore their plugin hang monitor. For example, suppose a browser's hang monitor normally waits 30 seconds before displaying its warning. Some browsers may implement <code>NPPVpluginPushDisableHangMonitorBool</code> by pausing their timer -- for example, if the plugin has already been hung for ten seconds, and then the plugin calls push and then pop, the browser might leave 20 seconds on its timer. Other browsers may reset their timer -- in the above example, they may put the timer back at 30 seconds remaining before a hang is detected.
| |