🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

uupaa.forceclick.js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uupaa.forceclick.js

Disable force click on link navigation

0.0.2
latest
Source
npm
Version published
Maintainers
1
Created
Source

ForceClick.js Build Status

npm

Disable force click on link navigation

  • Please refer to Spec and API Spec links.
  • The ForceClick.js is made of WebModule.

Browser and NW.js(node-webkit)

<style>
a[href] {
  font-size: 20pt;
}
.disable-force-click {
  color: blue;
  cursor: pointer;
  text-decoration: underline;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
</style>

<p>
  <a href="http://google.co.jp" class="disable-force-click">jump to google</a>
</p>

<script src="<module-dir>/lib/WebModule.js"></script>
<script src="<module-dir>/lib/WebGLDetector.js"></script>
<script src="<module-dir>/lib/UserAgent.js"></script>
<script src="<module-dir>/lib/SpecCatalog.js"></script>
<script src="<module-dir>/lib/Spec.js"></script>
<script src="<module-dir>/lib/ForceClick.js"></script>
<script>

var debug = true;
var ua    = new UserAgent();
var spec  = new Spec(ua);
var forceClick = null;

if (!debug) {
    // pretty code
    if (spec.FORCE_CLICK) {
        new ForceClick().disable();
    }
} else {
    if (spec.FORCE_CLICK) {
        ForceClick.VERBOSE = true;

        forceClick = new ForceClick(function(event,   // @arg Event - Event Object
                                             href,    // @arg URLString - href value
                                             force) { // @arg Number - force touch value. 0.0 - 1.0
            if (force <= 0.4) {
                document.body.style.cssText = "background-color: blue";
            } else {
                document.body.style.cssText = "background-color: yellow";
            }
            // reset bg-color
            setTimeout(function() {
                document.body.style.cssText = "background-color: white";
            }, 500);
        });

        forceClick.disable();
    }
}

</script>

Keywords

iOS

FAQs

Package last updated on 06 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts