Skip to content

Dexie.override()

David Fahlander edited this page May 6, 2014 · 3 revisions

Enables overriding existing functions and still be able to call the original function from within your overridden function.

Sample

The following sample shows how to log to console each time window.open() is called.

    window.open = Dexie.override(window.open, function(origFunc) {
        return function (url) {
            console.log("Opening url: " + url);
            return origFunc.apply(this, arguments);
        }
    }
Clone this wiki locally