forked from mattzeunert/javascript-breakpoint-collection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
injected-script.js
20 lines (17 loc) · 870 Bytes
/
injected-script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import consoleInterface , {pushRegisteredBreakpointsToExtension} from "./breakpoints/consoleInterface"
module.exports = consoleInterface;
var isInBrowser = typeof window !== "undefined";
if (isInBrowser) {
if (window.breakpoints !== undefined) {
if (!window.breakpoints.__internal || !window.breakpoints.__internal.isBreakpointCollectionExtension) {
console.log("Breakpoints extension can't load, global `breakpoints` variable is already defined")
}
} else {
window.breakpoints = consoleInterface;
pushRegisteredBreakpointsToExtension();
if (window.__BP_SHOW_CONSOLE_API_MESSAGE){
delete window.__BP_SHOW_CONSOLE_API_MESSAGE;
console.log("Breakpoints Collection API docs: https://github.com/mattzeunert/javascript-breakpoint-collection/blob/master/console-api.md")
}
}
}