The referrer needs to be the URL for the application you are hosting. It will not work when opening the file on your local machine. You will need a web server or to run it on a port on your localhost. You can serve your html file using node as a possible solution.
const http = require('http')
const fs = require('fs')
const server = http.createServer((req, res) => {
res.writeHead(200, { 'content-type': 'text/html' })
fs.createReadStream('index.html').pipe(res)
})
server.listen(process.env.PORT || 3000)
Then you would add 'http://localhost:3000' as the referrer to restrict usage.