
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
browser-history-flow-controller
Advanced tools
Browser History Flow Controller =================
Full control of back and forward keys on browser
<!-- Polyfill for old browsers -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<!-- Import the module -->
<script src="browser-history-flow-controller.js" charset="utf-8"></script>
var options = {
forwardButtonAutoEnable: true, //OPTIONAL: Enable forward key when back
forwardButtonAutoDisable: true, //OPTIONAL: Disable forward key when pushed new route
}
var historyController = new BrowserHistoryFlowController(window.history, options)
//triggers event 'navigate'
historyController.navigate('/otherpage')
//triggers event 'replace'
historyController.replace('/newpageurl')
//triggers event 'backward'
historyController.back()
//triggers event 'forward' only if forward button is enabled
historyController.forward()
//doesn't trigger any event
historyController.url = 'new url'
//Disable (=>) go forward button
historyController.disableForwardButton()
//Enable (=>) go forward button
historyController.enableForwardButton()
//Events are triggered globally
historyController.addEventListener('backward', function(event){
if(something){
event.cancel() //won't enable forward button
}
})
historyController.addEventListener('forward', function(event){
})
historyController.addEventListener('navigate', function(event){
console.log(event.lastLocation, event.location)
console.log(event.lastURL, event.lastURL)
console.log('Is hash change:', event.isHashChange)
if(!event.triggeredManually){
event.cancel() //url won't change
event.setUrl(differentUrl) //Replace url
}
})
historyController.addEventListener('replace', function(event){
console.log(event.lastLocation, event.location)
console.log(event.lastURL, event.lastURL)
})
historyController.addEventListener('exit', function(event){
if(!confirm('U sure?')) event.cancel()
})
//Also you can do
import BrowserHistoryFlowController from 'browser-history-flow-controller'
//Or
const BrowserHistoryFlowController = require('browser-history-flow-controller').default
FAQs
Browser History Flow Controller =================
We found that browser-history-flow-controller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.