New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

backtrack-js

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backtrack-js

A simple way to allow browsing history linking.

latest
Source
npmnpm
Version
2.0.2
Version published
Weekly downloads
8
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Backtrack for JavaScript

npm

A simple way to allow browsing history linking.

Installation

Yarn

$ yarn add backtrack-js

NPM

$ npm install backtrack-js

Usage

  • Assuming you have a back button with id="universal_back_button":

    <a href="" id="universal_back_button">Back</a>
    
  • On each page load, require and create a new Backtrack instance with the expected backButtonId.

    var Backtrack = require("backtrack-js");
    var backtrack = new Backtrack("universal_back_button");
    
  • Call configureBackButton() to configure the back button's URL (via href attribute) and to pop pages when clicked (via onClick attribute).

    backtrack.configureBackButton();
    
  • Call pushPage() to push the current page into the history stack so that when the user moves to the next page, clicking the back button, will return the user to the current page.

    backtrack.pushPage();
    
  • That's it! Your back button will now automatically be populated with the previous page's URL.

Contributing

We'd love to accept your patches and contributions to this project! Checkout contributing and code of conduct to learn more.

License

Refer to the license file.

Keywords

browser

FAQs

Package last updated on 13 Dec 2019

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