Skip to content

Gamble is a small and simply javascript library for dynamically add a resource-hints in your web pages

License

Notifications You must be signed in to change notification settings

kuzalekon/gamble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gamble

A small and simply javascript library for dynamically add a resource-hints in your web pages


MIT Chrome FireFox Opera Safari IE Edge

Installation

You can install gamble using npm, yarn or bower:

$ npm install gamble
$ yarn add gamble
$ bower install gamble

Usage

Note: the library is exports as UMD module.

const gamble = require('gamble');

// dns-prefetch
gamble({
    rel: 'dns-prefetch',
    href: 'https://domain.com'
});
// prefetch a script with CORS
gamble({
    rel: 'prefetch',
    href: 'https://domain.com/script.js',
    as: 'script',
    crossorigin: 'use-credentials'
});
// preload a HTML page
gamble({
    rel: 'preload',
    href: 'https://domain.com/index.html',
    as: 'html'
});
// prerender a page
gamble({
    rel: 'prerender',
    href: 'https://domain.com/index.html'
});

About

Gamble is a small and simply javascript library for dynamically add a resource-hints in your web pages

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published