Socket
Socket
Sign inDemoInstall

uupaa.forceclick.js

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    uupaa.forceclick.js

Disable force click on link navigation


Version published
Weekly downloads
7
increased by250%
Maintainers
1
Install size
91.5 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 06 Oct 2015

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc