The response has been limited to 50k tokens of the smallest files in the repo. You can remove this limitation by removing the max tokens filter.
├── .gitattributes
├── .gitignore
├── .jshintignore
├── .jshintrc
├── .npmignore
├── .travis.yml
├── CONTRIBUTING.md
├── ChangeLog.md
├── LICENSE
├── MAINTAINERS.md
├── README.md
├── bin
    ├── inspector.js
    ├── node-debug.js
    └── run-repl.js
├── docs
    └── embedding.md
├── front-end-node
    ├── Images
    │   ├── favicon.png
    │   └── src
    │   │   └── favicon.eps
    ├── NodeInspectorOverrides.js
    ├── console
    │   ├── ConsoleExtentions.js
    │   └── module.json
    ├── inspector.json
    ├── main
    │   ├── MainOverrides.js
    │   └── module.json
    ├── module.json
    ├── network
    │   ├── NetworkPanel.js
    │   └── module.json
    ├── profiler
    │   ├── SaveOverrides.js
    │   └── module.json
    ├── protocol.json
    ├── settings
    │   ├── SettingsScreenOverrides.css
    │   ├── SettingsScreenOverrides.js
    │   └── module.json
    └── sources
    │   ├── SourcesOverrides.js
    │   └── module.json
├── front-end
    ├── Images
    │   ├── applicationCache.png
    │   ├── back.png
    │   ├── breakpoint.png
    │   ├── breakpointConditional.png
    │   ├── breakpointConditional_2x.png
    │   ├── breakpoint_2x.png
    │   ├── checker.png
    │   ├── chromeDisabledSelect.png
    │   ├── chromeDisabledSelect_2x.png
    │   ├── chromeLeft.png
    │   ├── chromeMiddle.png
    │   ├── chromeRight.png
    │   ├── chromeSelect.png
    │   ├── chromeSelect_2x.png
    │   ├── cookie.png
    │   ├── database.png
    │   ├── databaseTable.png
    │   ├── deleteIcon.png
    │   ├── domain.png
    │   ├── errorWave.png
    │   ├── errorWave_2x.png
    │   ├── fileSystem.png
    │   ├── forward.png
    │   ├── frame.png
    │   ├── graphLabelCalloutLeft.png
    │   ├── graphLabelCalloutRight.png
    │   ├── indexedDB.png
    │   ├── indexedDBIndex.png
    │   ├── indexedDBObjectStore.png
    │   ├── localStorage.png
    │   ├── navigationControls.png
    │   ├── navigationControls_2x.png
    │   ├── paneAddButtons.png
    │   ├── paneElementStateButtons.png
    │   ├── paneFilterButtons.png
    │   ├── paneRefreshButtons.png
    │   ├── popoverArrows.png
    │   ├── popoverBackground.png
    │   ├── profileGroupIcon.png
    │   ├── profileIcon.png
    │   ├── profileSmallIcon.png
    │   ├── radioDot.png
    │   ├── resourceCSSIcon.png
    │   ├── resourceDocumentIcon.png
    │   ├── resourceDocumentIconSmall.png
    │   ├── resourceJSIcon.png
    │   ├── resourcePlainIcon.png
    │   ├── resourcePlainIconSmall.png
    │   ├── resourcesTimeGraphIcon.png
    │   ├── responsiveDesign.png
    │   ├── responsiveDesign_2x.png
    │   ├── searchNext.png
    │   ├── searchPrev.png
    │   ├── sessionStorage.png
    │   ├── settingsListRemove.png
    │   ├── settingsListRemove_2x.png
    │   ├── src
    │   │   ├── breakpoint.svg
    │   │   ├── breakpointConditional.svg
    │   │   ├── errorWave.svg
    │   │   ├── optimize_png.hashes
    │   │   ├── responsiveDesign.svg
    │   │   ├── settingsListRemove.svg
    │   │   ├── statusbarButtonGlyphs.svg
    │   │   └── svg2png.hashes
    │   ├── statusbarButtonGlyphs.png
    │   ├── statusbarButtonGlyphs_2x.png
    │   ├── statusbarResizerHorizontal.png
    │   ├── statusbarResizerVertical.png
    │   ├── thumbActiveHoriz.png
    │   ├── thumbActiveVert.png
    │   ├── thumbHoriz.png
    │   ├── thumbHoverHoriz.png
    │   ├── thumbHoverVert.png
    │   ├── thumbVert.png
    │   ├── toolbarItemSelected.png
    │   ├── touchCursor.png
    │   ├── touchCursor_2x.png
    │   ├── transformControls.png
    │   └── transformControls_2x.png
    ├── OWNERS
    ├── Runtime.js
    ├── UglifyJS
    │   └── parse-js.js
    ├── audits
    │   ├── AuditCategories.js
    │   ├── AuditCategory.js
    │   ├── AuditController.js
    │   ├── AuditExtensionCategory.js
    │   ├── AuditFormatters.js
    │   ├── AuditLauncherView.js
    │   ├── AuditResultView.js
    │   ├── AuditRules.js
    │   ├── AuditsPanel.js
    │   ├── auditsPanel.css
    │   └── module.json
    ├── bindings
    │   ├── BreakpointManager.js
    │   ├── CSSWorkspaceBinding.js
    │   ├── CompilerScriptMapping.js
    │   ├── ContentProviderBasedProjectDelegate.js
    │   ├── ContentScriptProjectDecorator.js
    │   ├── DebuggerWorkspaceBinding.js
    │   ├── DefaultScriptMapping.js
    │   ├── FileUtils.js
    │   ├── Linkifier.js
    │   ├── LiveLocation.js
    │   ├── NetworkUISourceCodeProvider.js
    │   ├── NetworkWorkspaceBinding.js
    │   ├── PresentationConsoleMessageHelper.js
    │   ├── ResourceScriptMapping.js
    │   ├── ResourceUtils.js
    │   ├── SASSSourceMapping.js
    │   ├── ScriptSnippetModel.js
    │   ├── StylesSourceMapping.js
    │   ├── TempFile.js
    │   ├── WorkspaceController.js
    │   └── module.json
    ├── cm
    │   ├── LICENSE
    │   ├── LICENSE_python
    │   ├── PRESUBMIT.py
    │   ├── clike.js
    │   ├── closebrackets.js
    │   ├── codemirror.css
    │   ├── codemirror.js
    │   ├── coffeescript.js
    │   ├── comment.js
    │   ├── css.js
    │   ├── headlesscodemirror.js
    │   ├── htmlembedded.js
    │   ├── htmlmixed.js
    │   ├── javascript.js
    │   ├── markselection.js
    │   ├── matchbrackets.js
    │   ├── overlay.js
    │   ├── php.js
    │   ├── python.js
    │   ├── shell.js
    │   └── xml.js
    ├── common
    │   ├── Color.js
    │   ├── Console.js
    │   ├── ContentProvider.js
    │   ├── Geometry.js
    │   ├── Lock.js
    │   ├── ModuleExtensionInterfaces.js
    │   ├── NotificationService.js
    │   ├── Object.js
    │   ├── ParsedURL.js
    │   ├── Progress.js
    │   ├── ResourceType.js
    │   ├── Settings.js
    │   ├── StaticContentProvider.js
    │   ├── TextRange.js
    │   ├── TextUtils.js
    │   ├── Throttler.js
    │   ├── UIString.js
    │   ├── WebInspector.js
    │   ├── WorkerRuntime.js
    │   └── module.json
    ├── components
    │   ├── CookiesTable.js
    │   ├── DOMBreakpointsSidebarPane.js
    │   ├── DOMPresentationUtils.js
    │   ├── DockController.js
    │   ├── Drawer.js
    │   ├── ExecutionContextSelector.js
    │   ├── HandlerRegistry.js
    │   ├── InspectElementModeController.js
    │   ├── InspectorView.js
    │   ├── NativeBreakpointsSidebarPane.js
    │   ├── ObjectPopoverHelper.js
    │   ├── ObjectPropertiesSection.js
    │   ├── ShortcutsScreen.js
    │   ├── TargetsComboBoxController.js
    │   ├── breakpointsList.css
    │   └── module.json
    ├── console
    │   ├── ConsolePanel.js
    │   ├── ConsoleView.js
    │   ├── ConsoleViewMessage.js
    │   ├── consoleView.css
    │   └── module.json
    ├── devices
    │   ├── DevicesView.js
    │   ├── devicesView.css
    │   └── module.json
    ├── devtools.css
    ├── devtools.html
    ├── devtools.js
    ├── devtools.json
    ├── devtools_app
    │   ├── DevToolsAPI.js
    │   ├── DevToolsApp.js
    │   ├── InspectorFrontendHostImpl.js
    │   ├── UITests.js
    │   └── module.json
    ├── dialog.css
    ├── documentation
    │   ├── DocumentationCatalog.js
    │   ├── DocumentationView.js
    │   ├── JSArticle.js
    │   ├── WikiParser.js
    │   ├── documentationView.css
    │   └── module.json
    ├── elements
    │   ├── AnimationsSidebarPane.js
    │   ├── ElementsBreadcrumbs.js
    │   ├── ElementsPanel.js
    │   ├── ElementsSidebarPane.js
    │   ├── ElementsTreeOutline.js
    │   ├── EventListenersSidebarPane.js
    │   ├── MetricsSidebarPane.js
    │   ├── PlatformFontsSidebarPane.js
    │   ├── PropertiesSidebarPane.js
    │   ├── Spectrum.js
    │   ├── StylesSectionModel.js
    │   ├── StylesSidebarPane.js
    │   ├── breadcrumbs.css
    │   ├── elementsPanel.css
    │   ├── elementsTreeOutline.css
    │   ├── module.json
    │   └── spectrum.css
    ├── extensions
    │   ├── ExtensionAPI.js
    │   ├── ExtensionAuditCategory.js
    │   ├── ExtensionPanel.js
    │   ├── ExtensionRegistryStub.js
    │   ├── ExtensionServer.js
    │   ├── ExtensionView.js
    │   └── module.json
    ├── externs.js
    ├── heap_snapshot_worker
    │   ├── AllocationProfile.js
    │   ├── HeapSnapshot.js
    │   ├── HeapSnapshotLoader.js
    │   ├── HeapSnapshotWorker.js
    │   ├── HeapSnapshotWorkerDispatcher.js
    │   ├── JSHeapSnapshot.js
    │   └── module.json
    ├── host
    │   ├── InspectorFrontendHost.js
    │   ├── Platform.js
    │   ├── UserMetrics.js
    │   └── module.json
    ├── inspector.css
    ├── inspector.html
    ├── inspector.js
    ├── inspector.json
    ├── inspectorCommon.css
    ├── inspectorStyle.css
    ├── inspectorSyntaxHighlight.css
    ├── layers
    │   ├── LayerPaintProfilerView.js
    │   ├── LayersPanel.js
    │   └── module.json
    ├── main
    │   ├── AdvancedApp.js
    │   ├── App.js
    │   ├── HelpScreenUntilReload.js
    │   ├── Main.js
    │   ├── OverridesView.js
    │   ├── RenderingOptions.js
    │   ├── ScreencastApp.js
    │   ├── SimpleApp.js
    │   ├── TestController.js
    │   ├── Tests.js
    │   ├── accelerometer.css
    │   ├── module.json
    │   └── overrides.css
    ├── network
    │   ├── FilterSuggestionBuilder.js
    │   ├── HARWriter.js
    │   ├── NetworkDataGridNode.js
    │   ├── NetworkItemView.js
    │   ├── NetworkLogView.js
    │   ├── NetworkPanel.js
    │   ├── NetworkTimeCalculator.js
    │   ├── RequestCookiesView.js
    │   ├── RequestHTMLView.js
    │   ├── RequestHeadersView.js
    │   ├── RequestJSONView.js
    │   ├── RequestPreviewView.js
    │   ├── RequestResponseView.js
    │   ├── RequestTimingView.js
    │   ├── RequestView.js
    │   ├── ResourceWebSocketFrameView.js
    │   ├── module.json
    │   ├── networkLogView.css
    │   ├── networkPanel.css
    │   ├── requestCookiesView.css
    │   ├── requestHeadersView.css
    │   └── webSocketFrameView.css
    ├── platform
    │   ├── DOMExtension.js
    │   ├── Promise.js
    │   ├── module.json
    │   └── utilities.js
    ├── popover.css
    ├── profiler
    │   ├── CPUProfileBottomUpDataGrid.js
    │   ├── CPUProfileDataGrid.js
    │   ├── CPUProfileFlameChart.js
    │   ├── CPUProfileTopDownDataGrid.js
    │   ├── CPUProfileView.js
    │   ├── CanvasProfileView.js
    │   ├── CanvasReplayStateView.js
    │   ├── HeapSnapshotCommon.js
    │   ├── HeapSnapshotDataGrids.js
    │   ├── HeapSnapshotGridNodes.js
    │   ├── HeapSnapshotProxy.js
    │   ├── HeapSnapshotView.js
    │   ├── ProfileLauncherView.js
    │   ├── ProfileTypeRegistry.js
    │   ├── ProfilesPanel.js
    │   ├── canvasProfiler.css
    │   ├── heapProfiler.css
    │   ├── module.json
    │   └── profilesPanel.css
    ├── promises
    │   ├── PromisePane.js
    │   ├── module.json
    │   └── promisePane.css
    ├── resources
    │   ├── ApplicationCacheItemsView.js
    │   ├── CookieItemsView.js
    │   ├── DOMStorageItemsView.js
    │   ├── DatabaseQueryView.js
    │   ├── DatabaseTableView.js
    │   ├── DirectoryContentView.js
    │   ├── FileContentView.js
    │   ├── FileSystemView.js
    │   ├── IndexedDBViews.js
    │   ├── ResourcesPanel.js
    │   ├── indexedDBViews.css
    │   ├── module.json
    │   └── resourcesPanel.css
    ├── screencast
    │   ├── ScreencastView.js
    │   ├── module.json
    │   └── screencastView.css
    ├── script_formatter_worker
    │   ├── CSSFormatter.js
    │   ├── JavaScriptFormatter.js
    │   ├── ScriptFormatterWorker.js
    │   └── module.json
    ├── sdk
    │   ├── AnimationModel.js
    │   ├── ApplicationCacheModel.js
    │   ├── BlackboxSupport.js
    │   ├── CPUProfileDataModel.js
    │   ├── CPUProfilerModel.js
    │   ├── CSSMetadata.js
    │   ├── CSSParser.js
    │   ├── CSSStyleModel.js
    │   ├── ConsoleModel.js
    │   ├── ContentProviders.js
    │   ├── CookieParser.js
    │   ├── DOMModel.js
    │   ├── DOMStorage.js
    │   ├── Database.js
    │   ├── DebuggerModel.js
    │   ├── FileSystemModel.js
    │   ├── HAREntry.js
    │   ├── HeapProfilerModel.js
    │   ├── IndexedDBModel.js
    │   ├── InspectorBackend.js
    │   ├── LayerTreeModel.js
    │   ├── NetworkLog.js
    │   ├── NetworkManager.js
    │   ├── NetworkRequest.js
    │   ├── OverridesSupport.js
    │   ├── PaintProfiler.js
    │   ├── PowerProfiler.js
    │   ├── RemoteObject.js
    │   ├── Resource.js
    │   ├── ResourceTreeModel.js
    │   ├── RuntimeModel.js
    │   ├── Script.js
    │   ├── SnippetStorage.js
    │   ├── SourceMap.js
    │   ├── Target.js
    │   ├── TracingManager.js
    │   ├── WorkerManager.js
    │   ├── WorkerTargetManager.js
    │   └── module.json
    ├── settings
    │   ├── EditFileSystemDialog.js
    │   ├── FrameworkBlackboxDialog.js
    │   ├── SettingsScreen.js
    │   └── module.json
    ├── sidebarPane.css
    ├── source_frame
    │   ├── CodeMirrorTextEditor.js
    │   ├── CodeMirrorUtils.js
    │   ├── FontView.js
    │   ├── GoToLineDialog.js
    │   ├── ImageView.js
    │   ├── ResourceSourceFrame.js
    │   ├── SourceFrame.js
    │   ├── cmdevtools.css
    │   ├── fontView.css
    │   ├── imageView.css
    │   ├── module.json
    │   └── resourceSourceFrame.css
    ├── sources
    │   ├── AddSourceMapURLDialog.js
    │   ├── AdvancedSearchView.js
    │   ├── BreakpointsSidebarPane.js
    │   ├── CSSSourceFrame.js
    │   ├── CallStackSidebarPane.js
    │   ├── EditingLocationHistoryManager.js
    │   ├── FileBasedSearchResultsPane.js
    │   ├── FilePathScoreFunction.js
    │   ├── FilteredItemSelectionDialog.js
    │   ├── InplaceFormatterEditorAction.js
    │   ├── JavaScriptSourceFrame.js
    │   ├── NavigatorView.js
    │   ├── Placard.js
    │   ├── RevisionHistoryView.js
    │   ├── ScopeChainSidebarPane.js
    │   ├── ScriptFormatter.js
    │   ├── ScriptFormatterEditorAction.js
    │   ├── SimpleHistoryManager.js
    │   ├── SourcesNavigator.js
    │   ├── SourcesPanel.js
    │   ├── SourcesSearchScope.js
    │   ├── SourcesView.js
    │   ├── StyleSheetOutlineDialog.js
    │   ├── TabbedEditorContainer.js
    │   ├── ThreadsSidebarPane.js
    │   ├── UISourceCodeFrame.js
    │   ├── WatchExpressionsSidebarPane.js
    │   ├── WorkspaceMappingTip.js
    │   ├── filteredItemSelectionDialog.css
    │   ├── jsdifflib.js
    │   ├── module.json
    │   ├── navigatorView.css
    │   ├── revisionHistory.css
    │   ├── sourcesPanel.css
    │   └── sourcesView.css
    ├── suggestBox.css
    ├── tabbedPane.css
    ├── temp_storage_shared_worker
    │   ├── TempStorageSharedWorker.js
    │   └── module.json
    ├── timeline
    │   ├── CountersGraph.js
    │   ├── LayerDetailsView.js
    │   ├── LayerTreeOutline.js
    │   ├── Layers3DView.js
    │   ├── MemoryCountersGraph.js
    │   ├── PaintProfilerView.js
    │   ├── TimelineEventOverview.js
    │   ├── TimelineFlameChart.js
    │   ├── TimelineFrameModel.js
    │   ├── TimelineFrameOverview.js
    │   ├── TimelineJSProfile.js
    │   ├── TimelineLayersView.js
    │   ├── TimelineMemoryOverview.js
    │   ├── TimelineModel.js
    │   ├── TimelineOverviewPane.js
    │   ├── TimelinePaintProfilerView.js
    │   ├── TimelinePanel.js
    │   ├── TimelinePowerGraph.js
    │   ├── TimelinePowerOverview.js
    │   ├── TimelinePresentationModel.js
    │   ├── TimelineUIUtils.js
    │   ├── TimelineView.js
    │   ├── TracingModel.js
    │   ├── TransformController.js
    │   ├── module.json
    │   └── timelinePanel.css
    ├── toolbox.css
    ├── toolbox.html
    ├── toolbox.js
    ├── toolbox.json
    ├── toolbox
    │   ├── InspectedPagePlaceholder.js
    │   ├── MediaQueryInspector.js
    │   ├── OverridesUI.js
    │   ├── ResponsiveDesignView.js
    │   ├── module.json
    │   └── responsiveDesignView.css
    ├── toolbox_bootstrap
    │   ├── Toolbox.js
    │   └── module.json
    ├── treeoutline.js
    ├── ui
    │   ├── ActionRegistry.js
    │   ├── CompletionDictionary.js
    │   ├── Context.js
    │   ├── ContextMenu.js
    │   ├── DOMSyntaxHighlighter.js
    │   ├── DataGrid.js
    │   ├── Dialog.js
    │   ├── DropDownMenu.js
    │   ├── EmptyView.js
    │   ├── FilterBar.js
    │   ├── FlameChart.js
    │   ├── ForwardedInputEventHandler.js
    │   ├── HelpScreen.js
    │   ├── InplaceEditor.js
    │   ├── KeyboardShortcut.js
    │   ├── OverviewGrid.js
    │   ├── Panel.js
    │   ├── PieChart.js
    │   ├── Popover.js
    │   ├── ProgressIndicator.js
    │   ├── ResizerWidget.js
    │   ├── RootView.js
    │   ├── SearchableView.js
    │   ├── Section.js
    │   ├── SettingsUI.js
    │   ├── ShortcutRegistry.js
    │   ├── ShowMoreDataGridNode.js
    │   ├── SidebarPane.js
    │   ├── SidebarTreeElement.js
    │   ├── SoftContextMenu.js
    │   ├── SortableDataGrid.js
    │   ├── SplitView.js
    │   ├── StackView.js
    │   ├── StatusBar.js
    │   ├── SuggestBox.js
    │   ├── TabbedPane.js
    │   ├── TextEditor.js
    │   ├── TextPrompt.js
    │   ├── TimelineGrid.js
    │   ├── UIUtils.js
    │   ├── View.js
    │   ├── ViewportControl.js
    │   ├── ViewportDataGrid.js
    │   ├── ZoomManager.js
    │   ├── dataGrid.css
    │   ├── filter.css
    │   ├── flameChart.css
    │   ├── helpScreen.css
    │   ├── module.json
    │   ├── overviewGrid.css
    │   ├── panelEnablerView.css
    │   ├── pieChart.css
    │   ├── progressIndicator.css
    │   ├── searchableView.css
    │   ├── splitView.css
    │   ├── statusBar.css
    │   └── treeoutline.js
    └── workspace
    │   ├── FileManager.js
    │   ├── FileSystemMapping.js
    │   ├── FileSystemWorkspaceBinding.js
    │   ├── IsolatedFileSystem.js
    │   ├── IsolatedFileSystemManager.js
    │   ├── SearchConfig.js
    │   ├── UISourceCode.js
    │   ├── Workspace.js
    │   └── module.json
├── index.js
├── lib
    ├── BreakEventHandler.js
    ├── CallFramesProvider.js
    ├── ConsoleAgent.js
    ├── ConsoleClient.js
    ├── DebuggerAgent.js
    ├── DebuggerClient.js
    ├── FrontendClient.js
    ├── FrontendCommandHandler.js
    ├── HeapProfilerAgent.js
    ├── HeapProfilerClient.js
    ├── Injections
    │   ├── ConsoleAgent.js
    │   ├── HeapProfilerAgent.js
    │   ├── NetworkAgent.js
    │   └── ProfilerAgent.js
    ├── InjectorClient.js
    ├── InjectorServer.js
    ├── NetworkAgent.js
    ├── PageAgent.js
    ├── ProfilerAgent.js
    ├── RuntimeAgent.js
    ├── ScriptFileStorage.js
    ├── ScriptManager.js
    ├── callback.js
    ├── config.js
    ├── convert.js
    ├── debug-server.js
    ├── debugger.js
    ├── plugins.js
    └── session.js
├── package.json
├── test
    ├── CallFramesProvider.js
    ├── ConsoleAgent.js
    ├── DebuggerAgent.js
    ├── DebuggerClient.js
    ├── FrontendCommandHandler.test.js
    ├── HeapProfilerAgent.js
    ├── InjectorClient.js
    ├── NetworkAgent.js
    ├── PageAgent.js
    ├── ProfilerAgent.js
    ├── RuntimeAgent.js
    ├── ScriptFileStorage.js
    ├── ScriptManager.js
    ├── config.js
    ├── convert.js
    ├── fixtures
    │   ├── BreakInFunction.js
    │   ├── Commandlet.js
    │   ├── InspectObject.js
    │   ├── LiveEdit.js
    │   ├── PeriodicConsoleLog.js
    │   └── ssl_cert_and_key.txt
    ├── helpers
    │   ├── SessionStub.js
    │   ├── launcher.js
    │   └── wsmock.js
    ├── index.js
    ├── mocha.opts
    ├── node-debug.test.js
    └── plugins.js
└── tools
    ├── git-changelog.sh
    ├── protocol.json
    ├── release.sh
    └── update-front-end.sh


/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | *.js text eol=lf
3 | 


--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
 1 | ._*
 2 | node_modules
 3 | plugins/*
 4 | v8.log
 5 | .DS_Store
 6 | .idea/
 7 | /test/fixtures/work
 8 | npm-debug.log
 9 | node-inspector-*.tgz
10 | 


--------------------------------------------------------------------------------
/.jshintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | /front-end
3 | /plugins


--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
 1 | {
 2 | "node": true,
 3 | "eqnull" : true,
 4 | "indent": 2,
 5 | "undef": true,
 6 | "quotmark": "single",
 7 | "maxlen": 105,
 8 | "trailing": true,
 9 | "newcap": true,
10 | "nonew": true,
11 | "sub": true,
12 | "globals": {
13 |   "describe": true,
14 |   "it": true,
15 |   "before": true,
16 |   "beforeEach": true,
17 |   "after": true,
18 |   "afterEach": true
19 | }
20 | }
21 | 


--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
 1 | ._*
 2 | node_modules
 3 | v8.log
 4 | .DS_Store
 5 | /.idea
 6 | /test
 7 | node-inspector-*.tgz
 8 | .npmignore
 9 | .travis.yml
10 | MAINTAINERS.md
11 | 


--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
 1 | sudo: false
 2 | language: node_js
 3 | node_js:
 4 |   - "0.10"
 5 |   - "0.12"
 6 |   - "4"
 7 |   - "5"
 8 |   - "6"
 9 |   - "7"
10 | 


--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
 1 | Before opening a pull request
 2 | =============================
 3 | 
 4 | - [Wiki article on contributing to Node Inspector](https://github.com/node-inspector/node-inspector/wiki/Contributing)
 5 | - [Developer's guide](https://github.com/node-inspector/node-inspector/wiki/Developer%27s-Guide)
 6 | 
 7 | Before opening an issue
 8 | =======================
 9 | 
10 | In order to facilitate reproduction of issues, please always provide the following info:
11 | 
12 | - node-inspector version (`node-inspector --version`)
13 | - node.js version (`node --version`)
14 | - operating system name and version
15 | 
16 | Please upgrade to the newest version before opening an issue:
17 | 
18 | `npm install -g node-inspector`
19 | 
20 | and check if it still is reproducible.
21 | 
22 | If the issue started happening after a recent upgrade, you can downgrade to an older version
23 | of Node Inspector with a command like this:
24 | 
25 | `npm install -g node-inspector@0.8.3`
26 | 
27 | Providing information if the bug is a recent regression will also facilitate its handling.
28 | 
29 | Click [here](https://github.com/node-inspector/node-inspector/releases) to find out
30 | what are the available versions.
31 | Alternatively you can also use the following command:
32 | 
33 | `npm view node-inspector`
34 | 


--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011, Danny Coates
2 | All rights reserved.
3 | 
4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5 | 
6 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


--------------------------------------------------------------------------------
/MAINTAINERS.md:
--------------------------------------------------------------------------------
 1 | ## How to release a new version
 2 | 
 3 | If you are running on Unix (Mac OSX, Linux), you can run `tools/release.sh`
 4 | that will run all steps for you:
 5 | 
 6 |     $ tools/release.sh X.Y.Z
 7 | 
 8 | ### Manual steps
 9 | 
10 | 1. Make sure all tests are passing:
11 | 
12 |         $ npm test
13 | 
14 | 1. Update the changelog
15 | 
16 |         $ tools/git-changelog X.Y.Z
17 | 
18 | 1. Update the version in package.json
19 | 
20 |         $ npm version --git-tag-version=false X.Y.Z
21 | 
22 | 1. Commit the changes to git
23 | 
24 |         $ git commit ChangeLog.md package.json -m X.Y.Z
25 | 
26 | 1. Create a git tag
27 | 
28 |         $ git tag -a vX.Y.Z -m X.Y.Z
29 | 
30 | 1. Push all changes to the server
31 | 
32 |         $ git push origin master vX.Y.Z
33 | 
34 | 1. Publish the package
35 | 
36 |         npm publish
37 | 
38 | 


--------------------------------------------------------------------------------
/bin/inspector.js:
--------------------------------------------------------------------------------
 1 | #!/usr/bin/env node
 2 | 
 3 | var DebugServer = require('../lib/debug-server').DebugServer,
 4 |     fs = require('fs'),
 5 |     path = require('path'),
 6 |     Config = require('../lib/config'),
 7 |     packageJson = require('../package.json');
 8 | 
 9 | var config = new Config(process.argv.slice(2));
10 | 
11 | if (config.help) {
12 |   config.showHelp();
13 |   process.exit();
14 | }
15 | 
16 | if (config.version) {
17 |   config.showVersion();
18 |   process.exit();
19 | }
20 | 
21 | process.on('SIGINT', function() {
22 |    process.exit();
23 | });
24 | 
25 | console.log('Node Inspector v%s', packageJson.version);
26 | 
27 | var debugServer = new DebugServer();
28 | debugServer.on('error', onError);
29 | debugServer.on('listening', onListening);
30 | debugServer.on('close', function () {
31 |   process.exit();
32 | });
33 | debugServer.start(config);
34 | 
35 | function onError(err) {
36 |   console.error(
37 |     'Cannot start the server at %s:%s. Error: %s.',
38 |     config.webHost,
39 |     config.webPort,
40 |     err.message || err
41 |   );
42 | 
43 |   if (err.code === 'EADDRINUSE') {
44 |     console.error(
45 |       'There is another process already listening at this address.\n' +
46 |       'Run `node-inspector --web-port={port}` to use a different port.'
47 |     );
48 |   }
49 | 
50 |   notifyParentProcess({
51 |     event: 'SERVER.ERROR',
52 |     error: err
53 |   });
54 | }
55 | 
56 | function onListening() {
57 |   var address = this.address();
58 |   console.log('Visit %s to start debugging.', address.url);
59 | 
60 |   notifyParentProcess({
61 |     event: 'SERVER.LISTENING',
62 |     address: address
63 |   });
64 | }
65 | 
66 | function notifyParentProcess(msg) {
67 |   if (!process.send) return;
68 | 
69 |   process.send(msg);
70 | }
71 | 


--------------------------------------------------------------------------------
/bin/run-repl.js:
--------------------------------------------------------------------------------
 1 | // Load the module contained in the current directory (cwd) and start REPL
 2 | // NOTE: Calls process.exit() after REPL was closed
 3 | 
 4 | var Module = require('module');
 5 | var path = require('path');
 6 | var repl = require('repl');
 7 | var util = require('util');
 8 | 
 9 | var location = process.cwd();
10 | 
11 | var moduleToDebug;
12 | var sampleLine;
13 | var prompt;
14 | 
15 | try {
16 |   loadAndDescribeModuleInCwd();
17 | } catch (e) {
18 |   sampleLine = util.format(
19 |     'The module in the current directory was not loaded: %s.',
20 |     e.message || e
21 |   );
22 | }
23 | 
24 | startRepl();
25 | 
26 | //---- Implementation ----
27 | 
28 | function loadAndDescribeModuleInCwd() {
29 | // Hack: Trick node into changing process.mainScript to moduleToDebug
30 |   moduleToDebug = Module._load(location, module, true);
31 | 
32 |   var sample = getSampleCommand();
33 |   sampleLine = util.format('You can access your module as `m`%s.', sample);
34 | 
35 |   prompt = getModuleName() + '> ';
36 | }
37 | 
38 | function startRepl() {
39 |   var cmd = process.env.CMD || process.argv[1];
40 | 
41 |   console.log(
42 |     '\nStarting the interactive shell (REPL). Type `.help` for help.\n' +
43 |       '%s\n' +
44 |       'Didn\'t want to start REPL? Run `%s .` instead.',
45 |     sampleLine,
46 |     cmd
47 |   );
48 | 
49 |   var r = repl.start( { prompt: prompt });
50 |   if (moduleToDebug !== undefined)
51 |     r.context.m = moduleToDebug;
52 |   r.on('exit', onReplExit);
53 | }
54 | 
55 | function onReplExit() {
56 |   console.log('\nLeaving the interactive shell (REPL).');
57 |   process.exit();
58 | }
59 | 
60 | function getModuleName() {
61 |   try {
62 |     var packageJson = require(path.join(location, 'package.json'));
63 |     if (packageJson.name)
64 |       return packageJson.name;
65 |   } catch (e) {
66 |     // ignore missing package.json
67 |   }
68 | 
69 |   return path.basename(location);
70 | }
71 | 
72 | function getSampleCommand() {
73 |   var exportedSymbols = Object.keys(moduleToDebug);
74 |   if (!exportedSymbols.length) return '';
75 | 
76 |   var sample = exportedSymbols[0];
77 |   if (typeof(moduleToDebug[sample]) === 'function')
78 |     sample += '()';
79 | 
80 |   return ', e.g. `m.' + sample + '`';
81 | }
82 | 


--------------------------------------------------------------------------------
/docs/embedding.md:
--------------------------------------------------------------------------------
 1 | # HOWTO embed Node Inspector
 2 | 
 3 | Node Inspector provides two ways of embedding in third-party
 4 | applications.
 5 | 
 6 | ## 1. Running in a new node process
 7 | 
 8 | 1. Start the Node Inspector in a new process using
 9 |   [child_process.fork()](http://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options)
10 | 2. Add `message` handler to get notified about Node Inspector events, use
11 |   `msg.event` to check which event was emitted.
12 | 
13 | ```js
14 | var fork = require('child_process').fork;
15 | 
16 | var inspectorArgs = [];
17 | var forkOptions = { silent: true };
18 | var inspector = fork(
19 |   require.resolve('node-inspector/bin/inspector'),
20 |   inspectorArgs,
21 |   forkOptions
22 | );
23 | 
24 | inspector.on('message', handleInspectorMessage);
25 | 
26 | function handleInspectorMessage(msg) {
27 |   switch(msg.event) {
28 |     case 'SERVER.LISTENING':
29 |       console.log('Visit %s to start debugging.', msg.address.url);
30 |       break;
31 |     case 'SERVER.ERROR':
32 |       console.log('Cannot start the server: %s.', msg.error.code);
33 |       break;
34 |   }
35 | }
36 | ```
37 | 
38 | ### Event: 'SERVER.LISTENING'
39 | 
40 | Emitted when the HTTP server was bound and is ready to accept connections.
41 | 
42 | Properties:
43 | 
44 |  * `address` - Server address as returned by `DebugServer.address()` (see
45 |    below).
46 | 
47 | ### Event: 'SERVER.ERROR'
48 | 
49 | Emitted when there was an error while setting up the HTTP server.
50 | 
51 | Properties:
52 | 
53 |  * `error` - The error.
54 | 
55 | ## 2. Running in an existing process
56 | 
57 | To be done. [index.js](../index.js) should expose method for creating and starting
58 | a DebugServer instance with a given config.
59 | 
60 | DebugServer is already exposing the following API:
61 | 
62 | ### debugServer.address()
63 | 
64 | Returns the result of `server.address()` plus the URL of the Node Inspector
65 | page to open in browser.
66 | 
67 | Example:
68 | ```js
69 | {
70 |   port: 8080,
71 |   address: '0.0.0.0',
72 |   url: 'http://localhost:8080/debug?port=5858'
73 | }
74 | ```
75 | 
76 | ### Event: 'listening'
77 | 
78 | Emitted when the HTTP server was bound and is ready to accept connections.
79 | 
80 | ### Event: 'error'
81 | 
82 | * Error Object
83 | 
84 | Emitted when there is an error in setting up the HTTP server.
85 | 
86 | 


--------------------------------------------------------------------------------
/front-end-node/Images/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end-node/Images/favicon.png


--------------------------------------------------------------------------------
/front-end-node/Images/src/favicon.eps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end-node/Images/src/favicon.eps


--------------------------------------------------------------------------------
/front-end-node/console/ConsoleExtentions.js:
--------------------------------------------------------------------------------
 1 | /*jshint browser:true, nonew:false, proto:true*/
 2 | /*global WebInspector:true, InspectorFrontendHost:true, InspectorFrontendHostAPI:true*/
 3 | WebInspector.ConsoleViewEventDispatcher = {
 4 |   Events: {
 5 |     MessageFormatted: 'MessageFormatted'
 6 |   },
 7 |   __proto__: WebInspector.Object.prototype
 8 | };
 9 | 
10 | WebInspector.ConsoleExtensions = function() {
11 |   this._extendConsoleDispatcher();
12 |   this._overrideFormattedMessage();
13 | };
14 | 
15 | WebInspector.ConsoleExtensions.prototype = {
16 |   _extendConsoleDispatcher: function() {
17 |     WebInspector.ConsoleDispatcher.prototype.showConsole = function() {
18 |       InspectorFrontendHost.events.dispatchEventToListeners(
19 |         InspectorFrontendHostAPI.Events.ShowConsole, WebInspector.inspectorView);
20 |     };
21 |   },
22 |   
23 |   _overrideFormattedMessage: function() {
24 |     WebInspector.ConsoleViewMessage.prototype.formattedMessage = function() {
25 |         if (!this._formattedMessage) {
26 |             this._formatMessage();
27 |             WebInspector.ConsoleViewEventDispatcher.dispatchEventToListeners(
28 |               WebInspector.ConsoleViewEventDispatcher.Events.MessageFormatted,
29 |               this._formattedMessage);
30 |         }
31 |         return this._formattedMessage;
32 |     };
33 |   }
34 | };
35 | 
36 | new WebInspector.ConsoleExtensions();
37 | 


--------------------------------------------------------------------------------
/front-end-node/console/module.json:
--------------------------------------------------------------------------------
1 | {
2 |     "dependencies": [
3 |         "console"
4 |     ],
5 |     "scripts": [
6 |         "ConsoleExtentions.js"
7 |     ]
8 | }
9 | 


--------------------------------------------------------------------------------
/front-end-node/inspector.json:
--------------------------------------------------------------------------------
 1 | [
 2 |   { "name": "node", "type": "autostart" },
 3 |   { "name": "node/profiler", "type": "autostart" },
 4 |   { "name": "node/network", "type": "autostart" },
 5 |   { "name": "node/settings", "type": "autostart" },
 6 |   { "name": "node/sources", "type": "autostart" },
 7 |   { "name": "node/console", "type": "autostart" },
 8 |   { "name": "node/main", "type": "autostart" },
 9 |   { "name": "audits", "type": "exclude"},
10 |   { "name": "elements", "type": "exclude"},
11 |   { "name": "timeline", "type": "exclude"},
12 |   { "name": "resources", "type": "exclude"}
13 | ]
14 | 


--------------------------------------------------------------------------------
/front-end-node/main/module.json:
--------------------------------------------------------------------------------
1 | {
2 |     "dependencies": [
3 |         "main"
4 |     ],
5 |     "scripts": [
6 |         "MainOverrides.js"
7 |     ]
8 | }
9 | 


--------------------------------------------------------------------------------
/front-end-node/module.json:
--------------------------------------------------------------------------------
1 | {
2 |     "dependencies": [
3 |         "sdk"
4 |     ],
5 |     "scripts": [
6 |         "NodeInspectorOverrides.js"
7 |     ]
8 | }
9 | 


--------------------------------------------------------------------------------
/front-end-node/network/NetworkPanel.js:
--------------------------------------------------------------------------------
 1 | /*jshint browser:true, nonew:false*/
 2 | /*global WebInspector:true, NetworkAgent:true*/
 3 | WebInspector.NetworkLogView.prototype.orig_toggleRecordButton =
 4 |   WebInspector.NetworkLogView.prototype._toggleRecordButton;
 5 | 
 6 | WebInspector.NetworkLogView.prototype._toggleRecordButton = function(toggled) {
 7 |   this.orig_toggleRecordButton.apply(this, arguments);
 8 | 
 9 |   if (!window.NetworkAgent) return;
10 |   NetworkAgent._setCapturingEnabled(this._recordButton.toggled());
11 | };
12 | 
13 | WebInspector.NetworkPanel._instance()._networkLogView.addEventListener(
14 |   WebInspector.NetworkLogView.EventTypes.ViewCleared,
15 |   function() {
16 |     NetworkAgent._clearCapturedData();
17 |   });
18 | 
19 | WebInspector.NetworkPanel._instance()._networkLogView._preserveLogCheckbox.setVisible(false);
20 | WebInspector.NetworkPanel._instance()._networkLogView._disableCacheCheckbox.setVisible(false);
21 | 


--------------------------------------------------------------------------------
/front-end-node/network/module.json:
--------------------------------------------------------------------------------
1 | {
2 |     "dependencies": [
3 |         "network"
4 |     ],
5 |     "scripts": [
6 |         "NetworkPanel.js"
7 |     ]
8 | }
9 | 


--------------------------------------------------------------------------------
/front-end-node/profiler/SaveOverrides.js:
--------------------------------------------------------------------------------
 1 | /*jshint browser:true, nonew:false*/
 2 | /*global WebInspector:true*/
 3 | 
 4 | WebInspector.saveAs = function(blob, filename) {
 5 |   var url = URL.createObjectURL(blob);
 6 |   var link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
 7 |   link.download = filename;
 8 |   link.href = url;
 9 |   link.click();
10 |   URL.revokeObjectURL(url);
11 | };
12 | 
13 | WebInspector.CPUProfileHeader.prototype.saveToFile = 
14 | WebInspector.HeapProfileHeader.prototype.saveToFile = function() {
15 |   var fileName = this._fileName || new Date().toISO8601Compact() + this._profileType.fileExtension();
16 | 
17 |   this._onTempFileReady = function() {
18 |     this._tempFile.read(function (data) {
19 |       WebInspector.saveAs(new Blob([data], {type: 'application/octet-stream'}), fileName);
20 |     });
21 | 
22 |     this._onTempFileReady = null;
23 |   };
24 | 
25 |   if (this._tempFile) this._onTempFileReady();
26 | };
27 | 


--------------------------------------------------------------------------------
/front-end-node/profiler/module.json:
--------------------------------------------------------------------------------
1 | {
2 |     "dependencies": [
3 |         "profiler"
4 |     ],
5 |     "scripts": [
6 |         "SaveOverrides.js"
7 |     ]
8 | }
9 | 


--------------------------------------------------------------------------------
/front-end-node/protocol.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "domains": [
 3 |       {
 4 |         "domain": "Console",
 5 |         "types": [],
 6 |         "commands": [],
 7 |         "events": [
 8 |             {
 9 |                 "name": "showConsole",
10 |                 "description": "Open console window"
11 |             }
12 |         ]
13 |       },
14 |       {
15 |         "domain": "Network",
16 |         "types": [],
17 |         "commands": [
18 |             {
19 |                 "name": "_clearCapturedData",
20 |                 "description": "Removes all saved requests data"
21 |             },
22 |             {
23 |                 "name": "_setCapturingEnabled",
24 |                 "parameters": [
25 |                     { "name": "enabled", "type": "boolean", "description": "True, if capturing enabled" }
26 |                 ],
27 |                 "description": "Disables capturing of http requests"
28 |             }
29 |         ],
30 |         "events": []
31 |       }
32 |     ]
33 | }
34 | 


--------------------------------------------------------------------------------
/front-end-node/settings/SettingsScreenOverrides.css:
--------------------------------------------------------------------------------
1 | /* Remove unusable tabs in help window */
2 | #tab-general, #general-tab-content { display: none; }
3 | #tab-overrides, #overrides-tab-content { display: none; }
4 | #tab-workspace, #workspace-tab-content { display: none; }
5 | 


--------------------------------------------------------------------------------
/front-end-node/settings/SettingsScreenOverrides.js:
--------------------------------------------------------------------------------
 1 | /*jshint browser:true, nonew:false*/
 2 | /*global WebInspector:true*/
 3 | WebInspector.SettingsScreenOverrides = function() {
 4 |   this._overrideShowSettingsScreen();
 5 | };
 6 | 
 7 | WebInspector.SettingsScreenOverrides.prototype = {
 8 |   _overrideShowSettingsScreen: function() {
 9 |     //Show only shortcuts
10 |     WebInspector.SettingsController.prototype.orig_showSettingsScreen =
11 |       WebInspector.SettingsController.prototype.showSettingsScreen;
12 |     WebInspector.SettingsController.prototype.showSettingsScreen = function() {
13 |       if (!this._settingsScreen)
14 |         this._settingsScreen = new WebInspector.SettingsScreen(this._onHideSettingsScreen.bind(this));
15 |       if (!this._overridenCssRegistered) {
16 |         this._settingsScreen.registerRequiredCSS('node/settings/SettingsScreenOverrides.css');
17 |         this._overridenCssRegistered = true;
18 |       }
19 |       this.orig_showSettingsScreen(WebInspector.SettingsScreen.Tabs.Shortcuts);
20 |     };
21 |   }
22 | };
23 | 
24 | new WebInspector.SettingsScreenOverrides();
25 | 


--------------------------------------------------------------------------------
/front-end-node/settings/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": [
 3 |         "settings"
 4 |     ],
 5 |     "scripts": [
 6 |         "SettingsScreenOverrides.js"
 7 |     ],
 8 |     "stylesheets": [
 9 |         "SettingsScreenOverrides.css"
10 |     ]
11 | }
12 | 


--------------------------------------------------------------------------------
/front-end-node/sources/SourcesOverrides.js:
--------------------------------------------------------------------------------
 1 | /*jshint browser:true, nonew:false*/
 2 | /*global WebInspector:true*/
 3 | WebInspector.SourcesOverrides = function() {
 4 |   this._chromeSpecificsAreHidden = false;
 5 |   this._hideChromeSpecifics();
 6 |   this._overrideWatchExpression();
 7 |   this._overrideShortcutsRegistering();
 8 | };
 9 | 
10 | WebInspector.SourcesOverrides.prototype = {
11 |   _hideChromeSpecifics: function() {
12 |     if (WebInspector.panels.sources) {
13 |       this._hideSourcesTabSpecifics();
14 |     } else {
15 |       WebInspector.inspectorView._tabbedPane.addEventListener(
16 |         WebInspector.TabbedPane.EventTypes.TabSelected,
17 |         function(event) {
18 |           if (event.data.tabId == 'sources') setTimeout(this._hideSourcesTabSpecifics.bind(this));
19 |         }, this);
20 |     }
21 |   },
22 | 
23 |   _hideSourcesTabSpecifics: function() {
24 |     if (this._chromeSpecificsAreHidden) return;
25 | 
26 |     var panes = WebInspector.panels.sources.sidebarPanes;
27 |     [
28 |       panes.domBreakpoints.element,
29 |       panes.domBreakpoints.titleElement.parentNode,
30 |       panes.eventListenerBreakpoints.element,
31 |       panes.eventListenerBreakpoints.titleElement.parentNode,
32 |       panes.xhrBreakpoints.element,
33 |       panes.xhrBreakpoints.titleElement.parentNode
34 |     ].forEach(function(element) {
35 |       element.classList.add('hidden');
36 |     });
37 |     this._chromeSpecificsAreHidden = true;
38 |   },
39 | 
40 |   _overrideWatchExpression: function() {
41 |     // Patch the expression used as an initial value for a new watch.
42 |     // DevTools' value "\n" breaks the debugger protocol.
43 |     WebInspector.WatchExpressionsSection.NewWatchExpression = ' ';
44 |   },
45 | 
46 |   _overrideShortcutsRegistering: function() {
47 |     // TODO(3y3): Check this before next front-end update.
48 |     // If it wasn't fixed we need to deprecate it anyway and search other way to fix.
49 |     setTimeout(function() {
50 |       WebInspector.SourcesPanel.prototype._createButtonAndRegisterShortcutsForAction =
51 |         function(buttonId, buttonTitle, actionId) {
52 |           function handler() {
53 |             WebInspector.actionRegistry.execute(actionId);
54 |             return true;
55 |           }
56 |           var shortcuts = WebInspector.shortcutRegistry.shortcutDescriptorsForAction(actionId);
57 |           return this._createButtonAndRegisterShortcuts(buttonId, buttonTitle, handler, shortcuts);
58 |         };
59 |     });
60 |   }
61 | };
62 | 
63 | new WebInspector.SourcesOverrides();
64 | 


--------------------------------------------------------------------------------
/front-end-node/sources/module.json:
--------------------------------------------------------------------------------
1 | {
2 |     "dependencies": [
3 |         "sources"
4 |     ],
5 |     "scripts": [
6 |         "SourcesOverrides.js"
7 |     ]
8 | }
9 | 


--------------------------------------------------------------------------------
/front-end/Images/applicationCache.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/applicationCache.png


--------------------------------------------------------------------------------
/front-end/Images/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/back.png


--------------------------------------------------------------------------------
/front-end/Images/breakpoint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/breakpoint.png


--------------------------------------------------------------------------------
/front-end/Images/breakpointConditional.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/breakpointConditional.png


--------------------------------------------------------------------------------
/front-end/Images/breakpointConditional_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/breakpointConditional_2x.png


--------------------------------------------------------------------------------
/front-end/Images/breakpoint_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/breakpoint_2x.png


--------------------------------------------------------------------------------
/front-end/Images/checker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/checker.png


--------------------------------------------------------------------------------
/front-end/Images/chromeDisabledSelect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/chromeDisabledSelect.png


--------------------------------------------------------------------------------
/front-end/Images/chromeDisabledSelect_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/chromeDisabledSelect_2x.png


--------------------------------------------------------------------------------
/front-end/Images/chromeLeft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/chromeLeft.png


--------------------------------------------------------------------------------
/front-end/Images/chromeMiddle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/chromeMiddle.png


--------------------------------------------------------------------------------
/front-end/Images/chromeRight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/chromeRight.png


--------------------------------------------------------------------------------
/front-end/Images/chromeSelect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/chromeSelect.png


--------------------------------------------------------------------------------
/front-end/Images/chromeSelect_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/chromeSelect_2x.png


--------------------------------------------------------------------------------
/front-end/Images/cookie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/cookie.png


--------------------------------------------------------------------------------
/front-end/Images/database.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/database.png


--------------------------------------------------------------------------------
/front-end/Images/databaseTable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/databaseTable.png


--------------------------------------------------------------------------------
/front-end/Images/deleteIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/deleteIcon.png


--------------------------------------------------------------------------------
/front-end/Images/domain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/domain.png


--------------------------------------------------------------------------------
/front-end/Images/errorWave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/errorWave.png


--------------------------------------------------------------------------------
/front-end/Images/errorWave_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/errorWave_2x.png


--------------------------------------------------------------------------------
/front-end/Images/fileSystem.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/fileSystem.png


--------------------------------------------------------------------------------
/front-end/Images/forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/forward.png


--------------------------------------------------------------------------------
/front-end/Images/frame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/frame.png


--------------------------------------------------------------------------------
/front-end/Images/graphLabelCalloutLeft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/graphLabelCalloutLeft.png


--------------------------------------------------------------------------------
/front-end/Images/graphLabelCalloutRight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/graphLabelCalloutRight.png


--------------------------------------------------------------------------------
/front-end/Images/indexedDB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/indexedDB.png


--------------------------------------------------------------------------------
/front-end/Images/indexedDBIndex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/indexedDBIndex.png


--------------------------------------------------------------------------------
/front-end/Images/indexedDBObjectStore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/indexedDBObjectStore.png


--------------------------------------------------------------------------------
/front-end/Images/localStorage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/localStorage.png


--------------------------------------------------------------------------------
/front-end/Images/navigationControls.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/navigationControls.png


--------------------------------------------------------------------------------
/front-end/Images/navigationControls_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/navigationControls_2x.png


--------------------------------------------------------------------------------
/front-end/Images/paneAddButtons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/paneAddButtons.png


--------------------------------------------------------------------------------
/front-end/Images/paneElementStateButtons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/paneElementStateButtons.png


--------------------------------------------------------------------------------
/front-end/Images/paneFilterButtons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/paneFilterButtons.png


--------------------------------------------------------------------------------
/front-end/Images/paneRefreshButtons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/paneRefreshButtons.png


--------------------------------------------------------------------------------
/front-end/Images/popoverArrows.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/popoverArrows.png


--------------------------------------------------------------------------------
/front-end/Images/popoverBackground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/popoverBackground.png


--------------------------------------------------------------------------------
/front-end/Images/profileGroupIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/profileGroupIcon.png


--------------------------------------------------------------------------------
/front-end/Images/profileIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/profileIcon.png


--------------------------------------------------------------------------------
/front-end/Images/profileSmallIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/profileSmallIcon.png


--------------------------------------------------------------------------------
/front-end/Images/radioDot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/radioDot.png


--------------------------------------------------------------------------------
/front-end/Images/resourceCSSIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/resourceCSSIcon.png


--------------------------------------------------------------------------------
/front-end/Images/resourceDocumentIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/resourceDocumentIcon.png


--------------------------------------------------------------------------------
/front-end/Images/resourceDocumentIconSmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/resourceDocumentIconSmall.png


--------------------------------------------------------------------------------
/front-end/Images/resourceJSIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/resourceJSIcon.png


--------------------------------------------------------------------------------
/front-end/Images/resourcePlainIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/resourcePlainIcon.png


--------------------------------------------------------------------------------
/front-end/Images/resourcePlainIconSmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/resourcePlainIconSmall.png


--------------------------------------------------------------------------------
/front-end/Images/resourcesTimeGraphIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/resourcesTimeGraphIcon.png


--------------------------------------------------------------------------------
/front-end/Images/responsiveDesign.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/responsiveDesign.png


--------------------------------------------------------------------------------
/front-end/Images/responsiveDesign_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/responsiveDesign_2x.png


--------------------------------------------------------------------------------
/front-end/Images/searchNext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/searchNext.png


--------------------------------------------------------------------------------
/front-end/Images/searchPrev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/searchPrev.png


--------------------------------------------------------------------------------
/front-end/Images/sessionStorage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/sessionStorage.png


--------------------------------------------------------------------------------
/front-end/Images/settingsListRemove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/settingsListRemove.png


--------------------------------------------------------------------------------
/front-end/Images/settingsListRemove_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/settingsListRemove_2x.png


--------------------------------------------------------------------------------
/front-end/Images/src/breakpoint.svg:
--------------------------------------------------------------------------------
1 | <?xml version="1.0" encoding="utf-8"?><svg height="11" version="1.1" width="26" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
2 | ><defs
3 | /><sodipodi:namedview showgrid="true"
4 | ><inkscape:grid empspacing="5" enabled="true" id="grid2985" snapvisiblegridlinesonly="true" type="xygrid" visible="true"/></sodipodi:namedview
5 | ><path d="m22.8 0.5 2.7 5-2.7 5-22.3 0 0-10z" fill="#698cfe" stroke="#4073f4"/></svg
6 | >


--------------------------------------------------------------------------------
/front-end/Images/src/breakpointConditional.svg:
--------------------------------------------------------------------------------
1 | <?xml version="1.0" encoding="utf-8"?><svg height="11" version="1.1" width="26" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
2 | ><defs
3 | /><sodipodi:namedview showgrid="true"
4 | ><inkscape:grid empspacing="5" enabled="true" id="grid2985" snapvisiblegridlinesonly="true" type="xygrid" visible="true"/></sodipodi:namedview
5 | ><path d="m22.8 0.5 2.7 5-2.7 5-22.3 0 0-10z" fill="#ef9d0d" stroke="#a36c01"/></svg
6 | >


--------------------------------------------------------------------------------
/front-end/Images/src/errorWave.svg:
--------------------------------------------------------------------------------
 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 2 | <!-- Created with Inkscape (http://www.inkscape.org/) -->
 3 | 
 4 | <svg
 5 |    xmlns:dc="http://purl.org/dc/elements/1.1/"
 6 |    xmlns:cc="http://creativecommons.org/ns#"
 7 |    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 8 |    xmlns:svg="http://www.w3.org/2000/svg"
 9 |    xmlns="http://www.w3.org/2000/svg"
10 |    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 |    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 |    width="6"
13 |    height="4"
14 |    id="svg2"
15 |    version="1.1"
16 |    inkscape:version="0.48.3.1 r9886"
17 |    inkscape:export-xdpi="97.627121"
18 |    inkscape:export-ydpi="97.627121"
19 |    sodipodi:docname="errorWave.svg">
20 |   <defs
21 |      id="defs4" />
22 |   <sodipodi:namedview
23 |      id="base"
24 |      pagecolor="#ffffff"
25 |      bordercolor="#666666"
26 |      borderopacity="1.0"
27 |      inkscape:pageopacity="0.0"
28 |      inkscape:pageshadow="2"
29 |      inkscape:zoom="90.509668"
30 |      inkscape:cx="3.4293179"
31 |      inkscape:cy="3.1283329"
32 |      inkscape:document-units="px"
33 |      inkscape:current-layer="layer1"
34 |      showgrid="true"
35 |      showguides="true"
36 |      inkscape:guide-bbox="true"
37 |      inkscape:window-width="2154"
38 |      inkscape:window-height="1195"
39 |      inkscape:window-x="399"
40 |      inkscape:window-y="129"
41 |      inkscape:window-maximized="0">
42 |     <inkscape:grid
43 |        type="xygrid"
44 |        id="grid2985"
45 |        empspacing="5"
46 |        visible="true"
47 |        enabled="true"
48 |        snapvisiblegridlinesonly="true" />
49 |   </sodipodi:namedview>
50 |   <metadata
51 |      id="metadata7">
52 |     <rdf:RDF>
53 |       <cc:Work
54 |          rdf:about="">
55 |         <dc:format>image/svg+xml</dc:format>
56 |         <dc:type
57 |            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
58 |         <dc:title />
59 |       </cc:Work>
60 |     </rdf:RDF>
61 |   </metadata>
62 |   <g
63 |      inkscape:label="Layer 1"
64 |      inkscape:groupmode="layer"
65 |      id="layer1"
66 |      transform="translate(0,-1048.3622)">
67 |     <path
68 |        style="fill:none;stroke:#ff0000;stroke-width:0.656;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
69 |        d="m -0.24596307,1048.8938 3.25701167,2.7917 3.2570116,-2.7917"
70 |        id="path3850"
71 |        inkscape:connector-curvature="0"
72 |        sodipodi:nodetypes="ccc" />
73 |   </g>
74 | </svg>
75 | 


--------------------------------------------------------------------------------
/front-end/Images/src/optimize_png.hashes:
--------------------------------------------------------------------------------
1 | {
2 |     "breakpointConditional.svg": "4cf90210b2af2ed84db2f60b07bcde28",
3 |     "errorWave.svg": "e183fa242a22ed4784a92f6becbc2c45",
4 |     "settingsListRemove.svg": "ce9e7c5c5cdaef28e6ee51d9478d5485",
5 |     "breakpoint.svg": "69cd92d807259c022791112809b97799",
6 |     "statusbarButtonGlyphs.svg": "8e09966eb691010ba2b19858115a0c77",
7 |     "responsiveDesign.svg": "1d6e963f88e5e448a7cff85f75a0e6b0"
8 | }


--------------------------------------------------------------------------------
/front-end/Images/src/responsiveDesign.svg:
--------------------------------------------------------------------------------
 1 | <?xml version="1.0" encoding="utf-8"?><svg height="16" version="1.1" width="112" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
 2 | ><defs
 3 | /><sodipodi:namedview showgrid="true"
 4 | ><inkscape:grid empspacing="5" enabled="true" id="grid3005" snapvisiblegridlinesonly="true" type="xygrid" visible="true"/></sodipodi:namedview
 5 | ><path d="M4.5 2.97 1.66 5.78 2.38 6.5 4 4.84 4 13 11.59 13 10 14.59 10.72 15.31 13.53 12.5 10.72 9.66 10 10.38 11.66 12 5 12 5 4.88 6.59 6.5 7.31 5.78z"
 6 | /><path d="m21 3 0 10 10 0 0-10zm1 1 8 0 0 8-8 0z"
 7 | /><path d="M23 5 23 8 24 8 24 6.72 27.28 10 26 10l0 1 3 0 0-3-1 0 0 1.31L24.69 6 26 6 26 5z"
 8 | /><path d="m40 2.25c-2.4 0-4.49 1.5-5.34 3.63L34.34 4.94 33.38 5.28 34.41 8.13 37.25 7.09 36.91 6.16 36.06 6.47C36.68 4.91 38.19 3.78 40 3.78c2.02 0 3.67 1.37 4.13 3.22l1.53 0C45.18 4.3 42.81 2.25 40 2.25zM45.41 7.81 42.69 9.09 43.09 10 43.91 9.63C43.26 11.15 41.78 12.25 40 12.25 37.98 12.25 36.32 10.85 35.88 9l-1.53 0c0.47 2.71 2.85 4.78 5.66 4.78 2.41 0 4.5-1.54 5.34-3.69l0.41 0.88 0.91-0.44z"
 9 | /><path d="m50 4 5 4 5-4" fill="none" stroke="#000"
10 | /><path d="m50 8 5 4 5-4" fill="none" stroke="#000"
11 | /><path d="M 71.5,2.5 C 69.02,2.5 67,4.52 67,7 c 0,2.48 2.02,4.5 4.5,4.5 1.07,0 2.04,-0.38 2.81,-1 l 2.84,2.84 0.69,-0.69 L 75,9.81 C 75.62,9.04 76,8.07 76,7 76,4.52 73.98,2.5 71.5,2.5 z m 0,1 C 73.44,3.5 75,5.06 75,7 75,8.94 73.44,10.5 71.5,10.5 69.56,10.5 68,8.94 68,7 68,5.06 69.56,3.5 71.5,3.5 z m 0,1.5 c -1.10,0 -2,0.90 -2,2 0,1.10 0.90,2 2,2 1.10,0 2,-0.90 2,-2 0,-1.10 -0.90,-2 -2,-2 z" fill="#000" stroke="none"
12 | /><path d="m 83,7 5,0 0,-5 2,0 0,5 5,0 0,2 -5,0 0,5 -2,0 0,-5 -5,0 z" fill="#000" stroke="none"
13 | /><path d="m 110,7 0,2 -11,0 0,-2 z"  fill="#000" stroke="none"/></svg
14 | >


--------------------------------------------------------------------------------
/front-end/Images/src/settingsListRemove.svg:
--------------------------------------------------------------------------------
 1 | <?xml version="1.0" encoding="utf-8"?><svg height="16" version="1.1" width="48" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
 2 | ><defs
 3 | /><sodipodi:namedview showgrid="false"
 4 | /><path d="M3 4.43 4.43 3 13 11.57 11.57 13z" fill="#8d8d8d"
 5 | /><path d="M4.43 13 3 11.57 11.57 3 13 4.43z" fill="#8d8d8d"
 6 | /><path d="M4.4 12.97 3.41 11.98 11.6 3.79 12.59 4.79z" fill="#ccc"
 7 | /><path d="M12.59 11.98 11.6 12.97 3.41 4.79 4.4 3.79z" fill="#ccc"
 8 | /><path d="m19 4.43 1.43-1.43 8.57 8.57-1.43 1.43z" fill="#121212"
 9 | /><path d="m20.43 13-1.43-1.43 8.57-8.57 1.43 1.43z" fill="#121212"
10 | /><path d="m20.4 12.97-0.99-0.99 8.19-8.19 0.99 0.99z" fill="#26262f" fill-opacity="0.94"
11 | /><path d="m28.59 11.98-0.99 0.99-8.19-8.19 0.99-0.99z" fill="#26262f" fill-opacity="0.94"
12 | /><path d="m35 4.43 1.43-1.43 8.57 8.57-1.43 1.43z" fill="#2e2e2e"
13 | /><path d="m36.43 13-1.43-1.43 8.57-8.57 1.43 1.43z" fill="#2e2e2e"
14 | /><path d="m36.4 12.97-0.99-0.99 8.19-8.19 0.99 0.99z" fill="#787878"
15 | /><path d="m44.59 11.98-0.99 0.99-8.19-8.19 0.99-0.99z" fill="#787878"/></svg
16 | >


--------------------------------------------------------------------------------
/front-end/Images/src/svg2png.hashes:
--------------------------------------------------------------------------------
1 | {
2 |     "breakpointConditional.svg": "4cf90210b2af2ed84db2f60b07bcde28",
3 |     "errorWave.svg": "e183fa242a22ed4784a92f6becbc2c45",
4 |     "settingsListRemove.svg": "ce9e7c5c5cdaef28e6ee51d9478d5485",
5 |     "breakpoint.svg": "69cd92d807259c022791112809b97799",
6 |     "statusbarButtonGlyphs.svg": "8e09966eb691010ba2b19858115a0c77",
7 |     "responsiveDesign.svg": "1d6e963f88e5e448a7cff85f75a0e6b0"
8 | }


--------------------------------------------------------------------------------
/front-end/Images/statusbarButtonGlyphs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/statusbarButtonGlyphs.png


--------------------------------------------------------------------------------
/front-end/Images/statusbarButtonGlyphs_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/statusbarButtonGlyphs_2x.png


--------------------------------------------------------------------------------
/front-end/Images/statusbarResizerHorizontal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/statusbarResizerHorizontal.png


--------------------------------------------------------------------------------
/front-end/Images/statusbarResizerVertical.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/statusbarResizerVertical.png


--------------------------------------------------------------------------------
/front-end/Images/thumbActiveHoriz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/thumbActiveHoriz.png


--------------------------------------------------------------------------------
/front-end/Images/thumbActiveVert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/thumbActiveVert.png


--------------------------------------------------------------------------------
/front-end/Images/thumbHoriz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/thumbHoriz.png


--------------------------------------------------------------------------------
/front-end/Images/thumbHoverHoriz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/thumbHoverHoriz.png


--------------------------------------------------------------------------------
/front-end/Images/thumbHoverVert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/thumbHoverVert.png


--------------------------------------------------------------------------------
/front-end/Images/thumbVert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/thumbVert.png


--------------------------------------------------------------------------------
/front-end/Images/toolbarItemSelected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/toolbarItemSelected.png


--------------------------------------------------------------------------------
/front-end/Images/touchCursor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/touchCursor.png


--------------------------------------------------------------------------------
/front-end/Images/touchCursor_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/touchCursor_2x.png


--------------------------------------------------------------------------------
/front-end/Images/transformControls.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/transformControls.png


--------------------------------------------------------------------------------
/front-end/Images/transformControls_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/node-inspector/node-inspector/79e01c049286374f86dd560742a614019c02402f/front-end/Images/transformControls_2x.png


--------------------------------------------------------------------------------
/front-end/OWNERS:
--------------------------------------------------------------------------------
1 | aandrey@chromium.org
2 | apavlov@chromium.org
3 | caseq@chromium.org
4 | dgozman@chromium.org
5 | loislo@chromium.org
6 | pfeldman@chromium.org
7 | vsevik@chromium.org
8 | yurys@chromium.org
9 | 


--------------------------------------------------------------------------------
/front-end/audits/AuditCategory.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (C) 2014 Google Inc. All rights reserved.
 3 |  *
 4 |  * Redistribution and use in source and binary forms, with or without
 5 |  * modification, are permitted provided that the following conditions are
 6 |  * met:
 7 |  *
 8 |  * 1. Redistributions of source code must retain the above copyright
 9 |  * notice, this list of conditions and the following disclaimer.
10 |  *
11 |  * 2. Redistributions in binary form must reproduce the above
12 |  * copyright notice, this list of conditions and the following disclaimer
13 |  * in the documentation and/or other materials provided with the
14 |  * distribution.
15 |  *
16 |  * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. AND ITS CONTRIBUTORS
17 |  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 |  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 |  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC.
20 |  * OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 |  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 |  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 |  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 |  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 |  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |  */
28 | 
29 | /**
30 |  * @interface
31 |  */
32 | WebInspector.AuditCategory = function()
33 | {
34 | }
35 | 
36 | WebInspector.AuditCategory.prototype = {
37 |     /**
38 |      * @return {string}
39 |      */
40 |     get id()
41 |     {
42 |     },
43 | 
44 |     /**
45 |      * @return {string}
46 |      */
47 |     get displayName()
48 |     {
49 |     },
50 | 
51 |     /**
52 |      * @param {!WebInspector.Target} target
53 |      * @param {!Array.<!WebInspector.NetworkRequest>} requests
54 |             * @param {function(!WebInspector.AuditRuleResult)} ruleResultCallback
55 |      * @param {function()} categoryDoneCallback
56 |      * @param {!WebInspector.Progress} progress
57 |      */
58 |     run: function(target, requests, ruleResultCallback, categoryDoneCallback, progress)
59 |     {
60 |     }
61 | }
62 | 


--------------------------------------------------------------------------------
/front-end/audits/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "@WebInspector.PanelFactory",
 5 |             "name": "audits",
 6 |             "title": "Audits",
 7 |             "order": 6,
 8 |             "className": "WebInspector.AuditsPanelFactory"
 9 |         }
10 |     ],
11 |     "dependencies": [
12 |         "components",
13 |         "extensions"
14 |     ],
15 |     "scripts": [
16 |         "AuditsPanel.js",
17 |         "AuditCategory.js",
18 |         "AuditCategories.js",
19 |         "AuditController.js",
20 |         "AuditFormatters.js",
21 |         "AuditLauncherView.js",
22 |         "AuditResultView.js",
23 |         "AuditRules.js",
24 |         "AuditExtensionCategory.js"
25 |     ],
26 |     "stylesheets": [
27 |         "auditsPanel.css"
28 |     ]
29 | }
30 | 


--------------------------------------------------------------------------------
/front-end/bindings/ContentScriptProjectDecorator.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  */
 8 | WebInspector.ContentScriptProjectDecorator = function()
 9 | {
10 |     WebInspector.targetManager.addModelListener(WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextCreated, this._onContextCreated, this);
11 |     WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.ProjectAdded, this._onProjectAdded, this);
12 | }
13 | 
14 | /**
15 |  * @param {!WebInspector.Project} project
16 |  * @param {!WebInspector.ExecutionContext} context
17 |  */
18 | WebInspector.ContentScriptProjectDecorator._updateProjectWithExtensionName = function(project, context)
19 | {
20 |     if (project.url().startsWith(context.origin))
21 |         project.setDisplayName(context.name);
22 | }
23 | 
24 | WebInspector.ContentScriptProjectDecorator.prototype = {
25 |     /**
26 |      * @param {!WebInspector.Event} event
27 |      */
28 |     _onContextCreated: function(event)
29 |     {
30 |         var context = /** @type {!WebInspector.ExecutionContext} */(event.data);
31 |         if (!context.origin || !context.name)
32 |             return;
33 | 
34 |         var projects = WebInspector.workspace.projects();
35 |         projects = projects.filter(contentProjectWithName);
36 | 
37 |         for (var i = 0; i < projects.length; ++i)
38 |             WebInspector.ContentScriptProjectDecorator._updateProjectWithExtensionName(projects[i], context);
39 | 
40 |         /**
41 |          * @param {!WebInspector.Project} project
42 |          * @return {boolean}
43 |          */
44 |         function contentProjectWithName(project)
45 |         {
46 |            return !!project.url() && project.type() === WebInspector.projectTypes.ContentScripts;
47 |         }
48 |     },
49 | 
50 |     /**
51 |      * @param {!WebInspector.Event} event
52 |      */
53 |     _onProjectAdded: function(event)
54 |     {
55 |         var project = /** @type {!WebInspector.Project} */(event.data);
56 |         if (project.type() !== WebInspector.projectTypes.ContentScripts)
57 |             return;
58 | 
59 |         var targets = WebInspector.targetManager.targets();
60 |         var contexts = [];
61 |         for (var i = 0; i < targets.length; ++i)
62 |             contexts = contexts.concat(targets[i].runtimeModel.executionContexts());
63 |         contexts = contexts.filter(contextWithOriginAndName);
64 | 
65 |         for (var i = 0; i < contexts.length; ++i)
66 |             WebInspector.ContentScriptProjectDecorator._updateProjectWithExtensionName(project, contexts[i]);
67 | 
68 |         /**
69 |          * @param {!WebInspector.ExecutionContext} context
70 |          * @return {boolean}
71 |          */
72 |         function contextWithOriginAndName(context)
73 |         {
74 |             return !!context.origin && !!context.name;
75 |         }
76 |     }
77 | }


--------------------------------------------------------------------------------
/front-end/bindings/LiveLocation.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegate
 8 |  */
 9 | WebInspector.LiveLocation = function(updateDelegate)
10 | {
11 |     this._updateDelegate = updateDelegate;
12 | }
13 | 
14 | WebInspector.LiveLocation.prototype = {
15 |     update: function()
16 |     {
17 |         var uiLocation = this.uiLocation();
18 |         if (!uiLocation)
19 |             return;
20 |         if (this._updateDelegate(uiLocation))
21 |             this.dispose();
22 |     },
23 | 
24 |     /**
25 |      * @return {?WebInspector.UILocation}
26 |      */
27 |     uiLocation: function()
28 |     {
29 |         throw "Not implemented";
30 |     },
31 | 
32 |     dispose: function()
33 |     {
34 |         // Overridden by subclasses.
35 |     }
36 | }
37 | 


--------------------------------------------------------------------------------
/front-end/bindings/WorkspaceController.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (C) 2013 Google Inc. All rights reserved.
 3 |  *
 4 |  * Redistribution and use in source and binary forms, with or without
 5 |  * modification, are permitted provided that the following conditions are
 6 |  * met:
 7 |  *
 8 |  *     * Redistributions of source code must retain the above copyright
 9 |  * notice, this list of conditions and the following disclaimer.
10 |  *     * Redistributions in binary form must reproduce the above
11 |  * copyright notice, this list of conditions and the following disclaimer
12 |  * in the documentation and/or other materials provided with the
13 |  * distribution.
14 |  *     * Neither the name of Google Inc. nor the names of its
15 |  * contributors may be used to endorse or promote products derived from
16 |  * this software without specific prior written permission.
17 |  *
18 |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 |  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 |  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 |  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 |  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 |  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 |  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 |  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 |  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 |  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |  */
30 | 
31 | /**
32 |  * @constructor
33 |  * @suppressGlobalPropertiesCheck
34 |  */
35 | WebInspector.WorkspaceController = function(workspace)
36 | {
37 |     this._workspace = workspace;
38 |     // Only for main window.
39 |     window.addEventListener("focus", this._windowFocused.bind(this), false);
40 |     this._fileSystemRefreshThrottler = new WebInspector.Throttler(1000);
41 | }
42 | 
43 | WebInspector.WorkspaceController.prototype = {
44 |     /**
45 |      * @param {!Event} event
46 |      */
47 |     _windowFocused: function(event)
48 |     {
49 |         this._fileSystemRefreshThrottler.schedule(refreshFileSystems.bind(this));
50 | 
51 |         /**
52 |          * @this {WebInspector.WorkspaceController}
53 |          * @param {!WebInspector.Throttler.FinishCallback} callback
54 |          */
55 |         function refreshFileSystems(callback)
56 |         {
57 |             var barrier = new CallbackBarrier();
58 |             var projects = this._workspace.projects();
59 |             for (var i = 0; i < projects.length; ++i)
60 |                 projects[i].refresh("/", barrier.createCallback());
61 |             barrier.callWhenDone(callback);
62 |         }
63 |     }
64 | }
65 | 


--------------------------------------------------------------------------------
/front-end/bindings/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": ["sdk", "platform", "workspace"],
 3 |     "scripts": [
 4 |         "LiveLocation.js",
 5 |         "CompilerScriptMapping.js",
 6 |         "ResourceScriptMapping.js",
 7 |         "SASSSourceMapping.js",
 8 |         "StylesSourceMapping.js",
 9 |         "CSSWorkspaceBinding.js",
10 |         "DebuggerWorkspaceBinding.js",
11 |         "BreakpointManager.js",
12 |         "ContentProviderBasedProjectDelegate.js",
13 |         "DefaultScriptMapping.js",
14 |         "FileUtils.js",
15 |         "Linkifier.js",
16 |         "NetworkUISourceCodeProvider.js",
17 |         "NetworkWorkspaceBinding.js",
18 |         "PresentationConsoleMessageHelper.js",
19 |         "ResourceUtils.js",
20 |         "ScriptSnippetModel.js",
21 |         "TempFile.js",
22 |         "WorkspaceController.js",
23 |         "ContentScriptProjectDecorator.js"
24 |     ]
25 | }
26 | 


--------------------------------------------------------------------------------
/front-end/cm/LICENSE:
--------------------------------------------------------------------------------
 1 | Copyright (C) 2014 by Marijn Haverbeke <marijnh@gmail.com> and others
 2 | 
 3 | Permission is hereby granted, free of charge, to any person obtaining a copy
 4 | of this software and associated documentation files (the "Software"), to deal
 5 | in the Software without restriction, including without limitation the rights
 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 7 | copies of the Software, and to permit persons to whom the Software is
 8 | furnished to do so, subject to the following conditions:
 9 | 
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 | 
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 | 


--------------------------------------------------------------------------------
/front-end/cm/LICENSE_python:
--------------------------------------------------------------------------------
 1 | The MIT License
 2 | 
 3 | Copyright (c) 2010 Timothy Farrell
 4 | 
 5 | Permission is hereby granted, free of charge, to any person obtaining a copy
 6 | of this software and associated documentation files (the "Software"), to deal
 7 | in the Software without restriction, including without limitation the rights
 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 | 
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 | 
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.


--------------------------------------------------------------------------------
/front-end/cm/PRESUBMIT.py:
--------------------------------------------------------------------------------
 1 | # Copyright (C) 2014 Google Inc. All rights reserved.
 2 | #
 3 | # Redistribution and use in source and binary forms, with or without
 4 | # modification, are permitted provided that the following conditions are
 5 | # met:
 6 | #
 7 | #     * Redistributions of source code must retain the above copyright
 8 | # notice, this list of conditions and the following disclaimer.
 9 | #     * Redistributions in binary form must reproduce the above
10 | # copyright notice, this list of conditions and the following disclaimer
11 | # in the documentation and/or other materials provided with the
12 | # distribution.
13 | #     * Neither the name of Google Inc. nor the names of its
14 | # contributors may be used to endorse or promote products derived from
15 | # this software without specific prior written permission.
16 | #
17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | 
29 | 
30 | def _CheckCodeMirrorChanges(input_api, output_api):
31 |     errorText = ("ERROR: Attempt to modify CodeMirror. The only allowed changes are "
32 |                  "rolls from the upstream (http://codemirror.net). If this is a roll, "
33 |                  "make sure you mention 'roll CodeMirror' (no quotes) in the change description.\n"
34 |                  "CodeMirror rolling instructions:\n"
35 |                  "    https://sites.google.com/a/chromium.org/devtools-codemirror-rolling")
36 |     changeDescription = input_api.change.DescriptionText()
37 |     errors = []
38 |     if not "roll codemirror" in changeDescription.lower():
39 |         errors.append(output_api.PresubmitError(errorText))
40 |     return errors
41 | 
42 | 
43 | def CheckChangeOnUpload(input_api, output_api):
44 |     results = []
45 |     results.extend(_CheckCodeMirrorChanges(input_api, output_api))
46 |     return results
47 | 


--------------------------------------------------------------------------------
/front-end/common/Lock.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @extends {WebInspector.Object}
 8 |  */
 9 | WebInspector.Lock = function()
10 | {
11 |     this._count = 0; // Reentrant.
12 | }
13 | 
14 | /**
15 |  * @enum {string}
16 |  */
17 | WebInspector.Lock.Events = {
18 |     StateChanged: "StateChanged"
19 | }
20 | 
21 | WebInspector.Lock.prototype = {
22 |     /**
23 |      * @return {boolean}
24 |      */
25 |     isAcquired: function()
26 |     {
27 |         return !!this._count;
28 |     },
29 | 
30 |     acquire: function()
31 |     {
32 |         if (++this._count === 1)
33 |             this.dispatchEventToListeners(WebInspector.Lock.Events.StateChanged);
34 |     },
35 | 
36 |     release: function()
37 |     {
38 |         --this._count;
39 |         if (this._count < 0) {
40 |             console.error("WebInspector.Lock acquire/release calls are unbalanced " + new Error().stack);
41 |             return;
42 |         }
43 |         if (!this._count)
44 |             this.dispatchEventToListeners(WebInspector.Lock.Events.StateChanged);
45 |     },
46 | 
47 |     __proto__: WebInspector.Object.prototype
48 | }
49 | 


--------------------------------------------------------------------------------
/front-end/common/ModuleExtensionInterfaces.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @interface
 7 |  */
 8 | WebInspector.Renderer = function()
 9 | {
10 | }
11 | 
12 | WebInspector.Renderer.prototype = {
13 |     /**
14 |      * @param {!Object} object
15 |      * @return {!Promise.<!Element>}
16 |      */
17 |     render: function(object) {}
18 | }
19 | 
20 | /**
21 |  * @param {!Object} object
22 |  * @return {!Promise.<!Element>}
23 |  */
24 | WebInspector.Renderer.renderPromise = function(object)
25 | {
26 |     if (!object)
27 |         return Promise.rejectWithError("Can't render " + object);
28 | 
29 |     return self.runtime.instancePromise(WebInspector.Renderer, object).then(render);
30 | 
31 |     /**
32 |      * @param {!WebInspector.Renderer} renderer
33 |      */
34 |     function render(renderer)
35 |     {
36 |         return renderer.render(object);
37 |     }
38 | }
39 | 
40 | /**
41 |  * @interface
42 |  */
43 | WebInspector.Revealer = function()
44 | {
45 | }
46 | 
47 | /**
48 |  * @param {?Object} revealable
49 |  * @param {number=} lineNumber
50 |  */
51 | WebInspector.Revealer.reveal = function(revealable, lineNumber)
52 | {
53 |     WebInspector.Revealer.revealPromise(revealable, lineNumber).done();
54 | }
55 | 
56 | /**
57 |  * @param {?Object} revealable
58 |  * @param {number=} lineNumber
59 |  * @return {!Promise.<undefined>}
60 |  */
61 | WebInspector.Revealer.revealPromise = function(revealable, lineNumber)
62 | {
63 |     if (!revealable)
64 |         return Promise.rejectWithError("Can't reveal " + revealable);
65 | 
66 |     return self.runtime.instancesPromise(WebInspector.Revealer, revealable).then(reveal);
67 | 
68 |     /**
69 |      * @param {!Array.<!WebInspector.Revealer>} revealers
70 |      * @return {!Promise.<undefined>}
71 |      */
72 |     function reveal(revealers)
73 |     {
74 |         var promises = [];
75 |         for (var i = 0; i < revealers.length; ++i)
76 |             promises.push(revealers[i].reveal(/** @type {!Object} */ (revealable), lineNumber));
77 |         return Promise.race(promises);
78 |     }
79 | }
80 | 
81 | WebInspector.Revealer.prototype = {
82 |     /**
83 |      * @param {!Object} object
84 |      * @param {number=} lineNumber
85 |      * @return {!Promise}
86 |      */
87 |     reveal: function(object, lineNumber) {}
88 | }
89 | 


--------------------------------------------------------------------------------
/front-end/common/NotificationService.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | /**
 8 |  * @constructor
 9 |  * @extends {WebInspector.Object}
10 |  */
11 | WebInspector.NotificationService = function() { }
12 | 
13 | WebInspector.NotificationService.prototype = {
14 |     __proto__: WebInspector.Object.prototype
15 | }
16 | 
17 | WebInspector.NotificationService.Events = {
18 |     InspectorAgentEnabledForTests: "InspectorAgentEnabledForTests",
19 |     SelectedNodeChanged: "SelectedNodeChanged"
20 | }
21 | 
22 | WebInspector.notifications = new WebInspector.NotificationService();
23 | 


--------------------------------------------------------------------------------
/front-end/common/StaticContentProvider.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @implements {WebInspector.ContentProvider}
 8 |  * @param {!WebInspector.ResourceType} contentType
 9 |  * @param {string} content
10 |  * @param {string=} contentURL
11 |  */
12 | WebInspector.StaticContentProvider = function(contentType, content, contentURL)
13 | {
14 |     this._content = content;
15 |     this._contentType = contentType;
16 |     this._contentURL = contentURL || "";
17 | }
18 | 
19 | /**
20 |  * @param {string} content
21 |  * @param {string} query
22 |  * @param {boolean} caseSensitive
23 |  * @param {boolean} isRegex
24 |  * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
25 |  */
26 | WebInspector.StaticContentProvider.searchInContent = function(content, query, caseSensitive, isRegex, callback)
27 | {
28 |     function performSearch()
29 |     {
30 |         callback(WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex));
31 |     }
32 | 
33 |     // searchInContent should call back later.
34 |     setTimeout(performSearch.bind(null), 0);
35 | }
36 | 
37 | WebInspector.StaticContentProvider.prototype = {
38 |     /**
39 |      * @return {string}
40 |      */
41 |     contentURL: function()
42 |     {
43 |         return this._contentURL;
44 |     },
45 | 
46 |     /**
47 |      * @return {!WebInspector.ResourceType}
48 |      */
49 |     contentType: function()
50 |     {
51 |         return this._contentType;
52 |     },
53 | 
54 |     /**
55 |      * @param {function(?string)} callback
56 |      */
57 |     requestContent: function(callback)
58 |     {
59 |         callback(this._content);
60 |     },
61 | 
62 |     /**
63 |      * @param {string} query
64 |      * @param {boolean} caseSensitive
65 |      * @param {boolean} isRegex
66 |      * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
67 |      */
68 |     searchInContent: function(query, caseSensitive, isRegex, callback)
69 |     {
70 |         WebInspector.StaticContentProvider.searchInContent(this._content, query, caseSensitive, isRegex, callback);
71 |     }
72 | }
73 | 


--------------------------------------------------------------------------------
/front-end/common/WebInspector.js:
--------------------------------------------------------------------------------
1 | /*
2 |  * Copyright 2014 The Chromium Authors. All rights reserved.
3 |  * Use of this source code is governed by a BSD-style license that can be
4 |  * found in the LICENSE file.
5 |  */
6 | 
7 | self.WebInspector = {}
8 | 


--------------------------------------------------------------------------------
/front-end/common/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": [
 3 |         "platform"
 4 |     ],
 5 |     "scripts": [
 6 |         "WorkerRuntime.js",
 7 |         "WebInspector.js",
 8 |         "Object.js",
 9 |         "NotificationService.js",
10 |         "Color.js",
11 |         "Geometry.js",
12 |         "Console.js",
13 |         "ContentProvider.js",
14 |         "Lock.js",
15 |         "ParsedURL.js",
16 |         "Progress.js",
17 |         "ResourceType.js",
18 |         "Settings.js",
19 |         "StaticContentProvider.js",
20 |         "TextRange.js",
21 |         "TextUtils.js",
22 |         "Throttler.js",
23 |         "UIString.js",
24 |         "ModuleExtensionInterfaces.js"
25 |     ]
26 | }
27 | 


--------------------------------------------------------------------------------
/front-end/components/TargetsComboBoxController.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @implements {WebInspector.TargetManager.Observer}
 8 |  * @param {!Element} selectElement
 9 |  * @param {!Element} elementToHide
10 |  */
11 | WebInspector.TargetsComboBoxController = function(selectElement, elementToHide)
12 | {
13 |     elementToHide.classList.add("hidden");
14 |     selectElement.addEventListener("change", this._onComboBoxSelectionChange.bind(this), false);
15 |     this._selectElement = selectElement;
16 |     this._elementToHide = elementToHide;
17 |     /** @type {!Map.<!WebInspector.Target, !Element>} */
18 |     this._targetToOption = new Map();
19 | 
20 |     WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._targetChangedExternally, this);
21 |     WebInspector.targetManager.observeTargets(this);
22 | }
23 | 
24 | WebInspector.TargetsComboBoxController.prototype = {
25 | 
26 |     /**
27 |      * @param {!WebInspector.Target} target
28 |      */
29 |     targetAdded: function(target)
30 |     {
31 |         var option = this._selectElement.createChild("option");
32 |         option.text = target.name();
33 |         option.__target = target;
34 |         this._targetToOption.set(target, option);
35 |         if (WebInspector.context.flavor(WebInspector.Target) === target)
36 |             this._selectElement.selectedIndex = Array.prototype.indexOf.call(/** @type {?} */ (this._selectElement), option);
37 | 
38 |         this._updateVisibility();
39 |     },
40 | 
41 |     /**
42 |      * @param {!WebInspector.Target} target
43 |      */
44 |     targetRemoved: function(target)
45 |     {
46 |         var option = this._targetToOption.remove(target);
47 |         this._selectElement.removeChild(option);
48 |         this._updateVisibility();
49 |     },
50 | 
51 |     _onComboBoxSelectionChange: function()
52 |     {
53 |         var selectedOption = this._selectElement[this._selectElement.selectedIndex];
54 |         if (!selectedOption)
55 |             return;
56 | 
57 |         WebInspector.context.setFlavor(WebInspector.Target, selectedOption.__target);
58 |     },
59 | 
60 |     _updateVisibility: function()
61 |     {
62 |         var hidden = this._selectElement.childElementCount === 1;
63 |         this._elementToHide.classList.toggle("hidden", hidden);
64 |     },
65 | 
66 |     /**
67 |      * @param {!WebInspector.Event} event
68 |      */
69 |     _targetChangedExternally: function(event)
70 |     {
71 |         var target = /** @type {?WebInspector.Target} */ (event.data);
72 |         if (target) {
73 |             var option = /** @type {!Element} */ (this._targetToOption.get(target));
74 |             this._select(option);
75 |         }
76 |     },
77 | 
78 |     /**
79 |      * @param {!Element} option
80 |      */
81 |     _select: function(option)
82 |     {
83 |         this._selectElement.selectedIndex = Array.prototype.indexOf.call(/** @type {?} */ (this._selectElement), option);
84 |     }
85 | 
86 | }
87 | 


--------------------------------------------------------------------------------
/front-end/components/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": [
 3 |         "bindings",
 4 |         "platform",
 5 |         "ui"
 6 |     ],
 7 |     "scripts": [
 8 |         "CookiesTable.js",
 9 |         "NativeBreakpointsSidebarPane.js",
10 |         "DOMBreakpointsSidebarPane.js",
11 |         "DOMPresentationUtils.js",
12 |         "DockController.js",
13 |         "Drawer.js",
14 |         "ExecutionContextSelector.js",
15 |         "HandlerRegistry.js",
16 |         "InspectElementModeController.js",
17 |         "InspectorView.js",
18 |         "ObjectPopoverHelper.js",
19 |         "ObjectPropertiesSection.js",
20 |         "ShortcutsScreen.js",
21 |         "TargetsComboBoxController.js"
22 |     ],
23 |     "stylesheets": [
24 |         "breakpointsList.css"
25 |     ]
26 | }
27 | 


--------------------------------------------------------------------------------
/front-end/console/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "@WebInspector.PanelFactory",
 5 |             "name": "console",
 6 |             "title": "Console",
 7 |             "order": 20,
 8 |             "className": "WebInspector.ConsolePanelFactory"
 9 |         },
10 |         {
11 |             "type": "drawer-view",
12 |             "name": "console",
13 |             "title": "Console",
14 |             "order": "0",
15 |             "className": "WebInspector.ConsolePanel.WrapperView"
16 |         },
17 |         {
18 |             "type": "@WebInspector.Revealer",
19 |             "contextTypes": ["WebInspector.Console"],
20 |             "className": "WebInspector.ConsolePanel.ConsoleRevealer"
21 |         },
22 |         {
23 |             "type": "@WebInspector.ActionDelegate",
24 |             "actionId": "console.show",
25 |             "className": "WebInspector.ConsoleView.ShowConsoleActionDelegate",
26 |             "bindings": [
27 |                 {
28 |                     "shortcut": "Ctrl+`"
29 |                 }
30 |             ]
31 |         },
32 |         {
33 |             "type": "ui-setting",
34 |             "section": "Console",
35 |             "title": "Hide network messages",
36 |             "settingName": "hideNetworkMessages",
37 |             "settingType": "checkbox"
38 |         },
39 |         {
40 |             "type": "ui-setting",
41 |             "section": "Console",
42 |             "title": "Log XMLHttpRequests",
43 |             "settingName": "monitoringXHREnabled",
44 |             "settingType": "checkbox"
45 |         },
46 |         {
47 |             "type": "ui-setting",
48 |             "section": "Console",
49 |             "title": "Preserve log upon navigation",
50 |             "settingName": "preserveConsoleLog",
51 |             "settingType": "checkbox"
52 |         },
53 |         {
54 |             "type": "ui-setting",
55 |             "section": "Console",
56 |             "title": "Show timestamps",
57 |             "settingName": "consoleTimestampsEnabled",
58 |             "settingType": "checkbox"
59 |         }
60 |     ],
61 |     "dependencies": [
62 |         "components"
63 |     ],
64 |     "scripts": [
65 |         "ConsoleViewMessage.js",
66 |         "ConsoleView.js",
67 |         "ConsolePanel.js"
68 |     ],
69 |     "stylesheets": [
70 |         "consoleView.css"
71 |     ]
72 | }
73 | 


--------------------------------------------------------------------------------
/front-end/devices/devicesView.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | .devices {
 7 |     padding: 10px;
 8 | }
 9 | 
10 | .devices-info {
11 |     flex: none;
12 |     padding-bottom: 10px;
13 | }
14 | 
15 | .browser {
16 |     align-items: baseline;
17 |     display: flex;
18 |     padding: 1px;
19 | }
20 | 
21 | .browser button {
22 |     white-space: nowrap;
23 |     flex: none;
24 | }
25 | 
26 | .device-header {
27 |     align-items: baseline;
28 |     display: flex;
29 |     flex-flow: row wrap;
30 |     padding: 2px 0;
31 | }
32 | 
33 | .device-name {
34 |     color: #222;
35 |     font-size: 120%;
36 |     font-weight: normal;
37 | }
38 | 
39 | .device-serial {
40 |     color: #888;
41 |     font-size: 80%;
42 |     margin-left: 6px;
43 |     font-weight: normal;
44 | }
45 | 
46 | .browser-name {
47 |     overflow: hidden;
48 |     padding-left: 20px;
49 |     padding-right: 10px;
50 |     flex: 0 1 250px;
51 |     text-overflow: ellipsis;
52 |     white-space: nowrap;
53 | }


--------------------------------------------------------------------------------
/front-end/devices/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "drawer-view",
 5 |             "name": "devices",
 6 |             "title": "Devices",
 7 |             "order": "12",
 8 |             "experiment": "devicesPanel",
 9 |             "className": "WebInspector.DevicesView"
10 |         }
11 |     ],
12 |     "dependencies": [
13 |         "platform",
14 |         "sdk",
15 |         "ui"
16 |     ],
17 |     "scripts": [ "DevicesView.js" ],
18 |     "stylesheets": [ "devicesView.css" ]
19 | }
20 | 


--------------------------------------------------------------------------------
/front-end/devtools.css:
--------------------------------------------------------------------------------
1 | /*
2 |  * Copyright 2014 The Chromium Authors. All rights reserved.
3 |  * Use of this source code is governed by a BSD-style license that can be
4 |  * found in the LICENSE file.
5 |  */
6 | 
7 | @import url("inspectorStyle.css");
8 | @import url("inspectorCommon.css");
9 | 


--------------------------------------------------------------------------------
/front-end/devtools.html:
--------------------------------------------------------------------------------
 1 | <!--
 2 |  * Copyright 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 | -->
 6 | <!doctype html>
 7 | <html>
 8 | <head>
 9 |     <meta http-equiv="content-type" content="text/html; charset=utf-8">
10 |     <meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' 'unsafe-inline'">
11 |     <link rel="stylesheet" type="text/css" href="devtools.css">
12 |     <script type="text/javascript" src="Runtime.js"></script>
13 |     <script type="text/javascript" src="devtools.js"></script>
14 | </head>
15 | <body class="undocked" id="-blink-dev-tools">
16 | <script>
17 | (function() {
18 |     var remoteFrontendUrl = Runtime.queryParam("remoteFrontendUrl");
19 |     var src = remoteFrontendUrl
20 |         ? decodeURIComponent(remoteFrontendUrl) + Runtime.constructQueryParams(["remoteFrontendUrl"])
21 |         : "inspector.html" + window.location.search;
22 |     document.write("<iframe id='inspector-app-iframe' class='fill' src='" + src + "'></iframe>");
23 | })();
24 | </script>
25 | </body>
26 | </html>
27 | 


--------------------------------------------------------------------------------
/front-end/devtools.js:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | 
5 | Runtime.startApplication("devtools");
6 | 


--------------------------------------------------------------------------------
/front-end/devtools.json:
--------------------------------------------------------------------------------
1 | [
2 |     { "name": "platform", "type": "autostart" },
3 |     { "name": "host", "type": "autostart" },
4 |     { "name": "common", "type": "autostart" },
5 |     { "name": "devtools_app", "type": "autostart" }
6 | ]
7 | 


--------------------------------------------------------------------------------
/front-end/devtools_app/DevToolsApp.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @suppressGlobalPropertiesCheck
 8 |  */
 9 | WebInspector.DevToolsApp = function()
10 | {
11 |     this._iframe = document.getElementById("inspector-app-iframe");
12 |     this._inspectorFrontendHostImpl = new WebInspector.InspectorFrontendHostImpl();
13 | 
14 |     /**
15 |      * @type {!Window}
16 |      */
17 |     this._inspectorWindow = this._iframe.contentWindow;
18 |     this._inspectorWindow.InspectorFrontendHost = this._inspectorFrontendHostImpl;
19 |     DevToolsAPI.setInspectorWindow(this._inspectorWindow);
20 | }
21 | 
22 | WebInspector.DevToolsApp.prototype = {
23 | }
24 | 
25 | runOnWindowLoad(function() { new WebInspector.DevToolsApp(); });
26 | 


--------------------------------------------------------------------------------
/front-end/devtools_app/UITests.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | if (window.domAutomationController) {
 6 |     var uiTests = {};
 7 | 
 8 |     uiTests.runTest = function(name)
 9 |     {
10 |         if (uiTests._testSuite)
11 |             uiTests._testSuite._runTest(name);
12 |         else
13 |             uiTests._pendingTestName = name;
14 |     };
15 | 
16 |     uiTests.testSuiteReady = function(testSuiteConstructor)
17 |     {
18 |         uiTests._testSuite = testSuiteConstructor(window.domAutomationController);
19 |         if (uiTests._pendingTestName) {
20 |             var name = uiTests._pendingTestName;
21 |             delete uiTests._pendingTestName;
22 |             uiTests._testSuite._runTest(name);
23 |         }
24 |     };
25 | }
26 | 


--------------------------------------------------------------------------------
/front-end/devtools_app/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": [
 3 |         "common",
 4 |         "host",
 5 |         "platform"
 6 |     ],
 7 |     "scripts": [
 8 |         "UITests.js",
 9 |         "DevToolsAPI.js",
10 |         "InspectorFrontendHostImpl.js",
11 |         "DevToolsApp.js"
12 |     ],
13 |     "skip_compilation": [
14 |         "UITests.js"
15 |     ]
16 | }
17 | 


--------------------------------------------------------------------------------
/front-end/dialog.css:
--------------------------------------------------------------------------------
 1 | .dialog {
 2 |     position: absolute;
 3 |     border: 1px solid rgb(204, 204, 204);
 4 |     box-shadow: rgb(140, 140, 140) 0 3px 14px;
 5 |     display: flex;
 6 |     -webkit-flex-direction: column;
 7 | }
 8 | 
 9 | .dialog-contents {
10 |     width: 100%;
11 | }
12 | 
13 | .go-to-line-dialog {
14 |     font-family: 'Lucida Grande', sans-serif;
15 |     padding: 10px;
16 |     font-size: inherit;
17 | }
18 | 
19 | .dialog input[type=text] {
20 |     font-size: inherit;
21 |     height: 24px;
22 |     padding-left: 2px;
23 |     margin: 0 5px;
24 | }
25 | 
26 | .dialog button {
27 |     background-image: linear-gradient(hsl(0, 0%, 93%), hsl(0, 0%, 93%) 38%, hsl(0, 0%, 87%));
28 |     border: 1px solid hsla(0, 0%, 0%, 0.25);
29 |     border-radius: 2px;
30 |     box-shadow: 0 1px 0 hsla(0, 0%, 0%, 0.08), inset 0 1px 2px hsla(0, 100%, 100%, 0.75);
31 |     color: hsl(0, 0%, 27%);
32 |     font-size: 12px;
33 |     margin: 0 1px 0 6px;
34 |     text-shadow: 0 1px 0 hsl(0, 0%, 94%);
35 |     min-height: 2em;
36 |     padding-left: 10px;
37 |     padding-right: 10px;
38 | }
39 | 
40 | .dialog button:active {
41 |     background-color: rgb(215, 215, 215);
42 |     background-image: linear-gradient(to bottom, rgb(194, 194, 194), rgb(239, 239, 239));
43 | }
44 | 
45 | .dialog input[type="search"]:focus,
46 | .dialog input[type="text"]:focus {
47 |     outline: none;
48 | }
49 | 
50 | 


--------------------------------------------------------------------------------
/front-end/documentation/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "@WebInspector.ContextMenu.Provider",
 5 |             "contextTypes": [ "WebInspector.CodeMirrorTextEditor" ],
 6 |             "className": "WebInspector.DocumentationView.ContextMenuProvider"
 7 |         }
 8 |     ],
 9 |     "dependencies": ["source_frame"],
10 |     "experiment": "documentation",
11 |     "scripts": [
12 |         "WikiParser.js",
13 |         "JSArticle.js",
14 |         "DocumentationCatalog.js",
15 |         "DocumentationView.js"
16 |     ],
17 |     "stylesheets": [
18 |         "documentationView.css"
19 |     ]
20 | }


--------------------------------------------------------------------------------
/front-end/elements/ElementsSidebarPane.js:
--------------------------------------------------------------------------------
 1 | // Copyright (c) 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @extends {WebInspector.SidebarPane}
 8 |  * @param {string} title
 9 |  */
10 | WebInspector.ElementsSidebarPane = function(title)
11 | {
12 |     WebInspector.SidebarPane.call(this, title);
13 |     this._updateThrottler = new WebInspector.Throttler(100);
14 |     this._node = null;
15 | }
16 | 
17 | WebInspector.ElementsSidebarPane.prototype = {
18 |     /**
19 |      * @return {?WebInspector.DOMNode}
20 |      */
21 |     node: function()
22 |     {
23 |         return this._node;
24 |     },
25 | 
26 |     /**
27 |      * @param {?WebInspector.DOMNode} node
28 |      */
29 |     setNode: function(node)
30 |     {
31 |         this._node = node;
32 |         this.update();
33 |     },
34 | 
35 |     /**
36 |      * @param {!WebInspector.Throttler.FinishCallback} finishedCallback
37 |      * @protected
38 |      */
39 |     doUpdate: function(finishedCallback)
40 |     {
41 |         finishedCallback();
42 |     },
43 | 
44 |     update: function()
45 |     {
46 |         this._updateWhenVisible = !this.isShowing();
47 |         if (this._updateWhenVisible)
48 |             return;
49 |         this._updateThrottler.schedule(innerUpdate.bind(this));
50 | 
51 |         /**
52 |          * @param {!WebInspector.Throttler.FinishCallback} finishedCallback
53 |          * @this {WebInspector.ElementsSidebarPane}
54 |          */
55 |         function innerUpdate(finishedCallback)
56 |         {
57 |             if (this.isShowing())
58 |                 this.doUpdate(finishedCallback);
59 |             else
60 |                 finishedCallback();
61 |         }
62 |     },
63 | 
64 |     wasShown: function()
65 |     {
66 |         WebInspector.SidebarPane.prototype.wasShown.call(this);
67 |         this.update();
68 |     },
69 | 
70 |     __proto__: WebInspector.SidebarPane.prototype
71 | }
72 | 


--------------------------------------------------------------------------------
/front-end/elements/breadcrumbs.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | .crumbs {
 8 |     display: inline-block;
 9 |     pointer-events: auto;
10 |     cursor: default;
11 |     font-size: 11px;
12 |     line-height: 17px;
13 | }
14 | 
15 | .crumbs .crumb {
16 |     display: inline-block;
17 |     padding: 0 7px;
18 |     height: 18px;
19 |     white-space: nowrap;
20 | }
21 | 
22 | .crumbs .crumb.collapsed > * {
23 |     display: none;
24 | }
25 | 
26 | .crumbs .crumb.collapsed::before {
27 |     content: "\2026";
28 |     font-weight: bold;
29 | }
30 | 
31 | .crumbs .crumb.compact .extra {
32 |     display: none;
33 | }
34 | 
35 | .crumbs .crumb.selected, .crumbs .crumb.selected:hover {
36 |     background-color: rgb(56, 121, 217);
37 |     color: white;
38 |     text-shadow: rgba(255, 255, 255, 0.5) 0 0 0;
39 | }
40 | 
41 | .crumbs .crumb:hover {
42 |     background-color: rgb(216, 216, 216);
43 | }
44 | 


--------------------------------------------------------------------------------
/front-end/elements/spectrum.css:
--------------------------------------------------------------------------------
  1 | /* https://github.com/bgrins/spectrum */
  2 | :host {
  3 |     width: 205px;
  4 |     height: 220px;
  5 |     -webkit-user-select: none;
  6 | }
  7 | 
  8 | .spectrum-color {
  9 |     position: absolute;
 10 |     top: 5px;
 11 |     left: 5px;
 12 |     width: 158px;
 13 |     height: 158px;
 14 |     outline: 1px solid #bbb;
 15 | }
 16 | 
 17 | .spectrum-display-value {
 18 |     -webkit-user-select: text;
 19 |     display: inline-block;
 20 |     padding-left: 2px;
 21 | }
 22 | 
 23 | .spectrum-hue {
 24 |     position: absolute;
 25 |     top: 5px;
 26 |     right: 5px;
 27 |     width: 28px;
 28 |     height: 158px;
 29 |     -webkit-box-reflect: right -28px;
 30 | }
 31 | 
 32 | .spectrum-range-container {
 33 |     position: absolute;
 34 |     bottom: 28px;
 35 |     left: 5px;
 36 |     display: flex;
 37 |     align-items: center;
 38 | }
 39 | 
 40 | .spectrum-text {
 41 |     position: absolute;
 42 |     bottom: 5px;
 43 |     left: 5px;
 44 |     display: flex;
 45 |     align-items: center;
 46 | }
 47 | 
 48 | .spectrum-range-container * {
 49 |     font-size: 11px;
 50 |     vertical-align: middle;
 51 | }
 52 | 
 53 | .spectrum-range-container label {
 54 |     display: inline-block;
 55 |     padding-right: 4px;
 56 | }
 57 | 
 58 | .spectrum-dragger,
 59 | .spectrum-slider {
 60 |     -webkit-user-select: none;
 61 | }
 62 | 
 63 | .spectrum-sat {
 64 |     background-image: linear-gradient(to right, white, rgba(204, 154, 129, 0));
 65 | }
 66 | 
 67 | .spectrum-val {
 68 |     background-image: linear-gradient(to top, black, rgba(204, 154, 129, 0));
 69 | }
 70 | 
 71 | .spectrum-hue {
 72 |     background: linear-gradient(to top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
 73 | }
 74 | 
 75 | .spectrum-dragger {
 76 |     border-radius: 5px;
 77 |     height: 5px;
 78 |     width: 5px;
 79 |     border: 1px solid white;
 80 |     cursor: pointer;
 81 |     position: absolute;
 82 |     top: 0;
 83 |     left: 0;
 84 |     background: black;
 85 | }
 86 | 
 87 | .spectrum-slider {
 88 |     position: absolute;
 89 |     top: 0;
 90 |     cursor: pointer;
 91 |     border: 1px solid black;
 92 |     height: 4px;
 93 |     left: -1px;
 94 |     right: -1px;
 95 | }
 96 | 
 97 | .swatch {
 98 |     width: 20px;
 99 |     height:20px;
100 |     margin: 0;
101 | }
102 | 
103 | .swatch-inner {
104 |     width: 100%;
105 |     height: 100%;
106 |     display: inline-block;
107 |     border: 1px solid rgba(128, 128, 128, 0.6);
108 | }
109 | 
110 | .swatch-inner:hover {
111 |     border: 1px solid rgba(64, 64, 64, 0.8);
112 | }
113 | 


--------------------------------------------------------------------------------
/front-end/extensions/ExtensionAuditCategory.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (C) 2012 Google Inc. All rights reserved.
 3 |  *
 4 |  * Redistribution and use in source and binary forms, with or without
 5 |  * modification, are permitted provided that the following conditions are
 6 |  * met:
 7 |  *
 8 |  *     * Redistributions of source code must retain the above copyright
 9 |  * notice, this list of conditions and the following disclaimer.
10 |  *     * Redistributions in binary form must reproduce the above
11 |  * copyright notice, this list of conditions and the following disclaimer
12 |  * in the documentation and/or other materials provided with the
13 |  * distribution.
14 |  *     * Neither the name of Google Inc. nor the names of its
15 |  * contributors may be used to endorse or promote products derived from
16 |  * this software without specific prior written permission.
17 |  *
18 |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 |  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 |  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 |  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 |  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 |  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 |  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 |  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 |  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 |  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |  */
30 | 
31 | /**
32 |  * @constructor
33 |  * @param {string} extensionOrigin
34 |  * @param {string} id
35 |  * @param {string} displayName
36 |  * @param {number=} ruleCount
37 |  */
38 | WebInspector.ExtensionAuditCategory = function(extensionOrigin, id, displayName, ruleCount)
39 | {
40 |     this.extensionOrigin = extensionOrigin;
41 |     this.id = id;
42 |     this.displayName = displayName;
43 |     this.ruleCount  = ruleCount;
44 | }
45 | 
46 | /**
47 |  * @interface
48 |  */
49 | WebInspector.ExtensionAuditCategoryResults = function()
50 | {
51 | }
52 | 
53 | WebInspector.ExtensionAuditCategoryResults.prototype = {
54 |     /**
55 |      * @return {string}
56 |      */
57 |     id: function() { },
58 | 
59 |     /**
60 |      * @param {string} displayName
61 |      * @param {string} description
62 |      * @param {string} severity
63 |      * @param {!Object} details
64 |      */
65 |     addResult: function(displayName, description, severity, details) { },
66 | 
67 |     /**
68 |      * @param {number} progress
69 |      */
70 |     updateProgress: function(progress) { },
71 | 
72 |     done: function() { }
73 | }
74 | 


--------------------------------------------------------------------------------
/front-end/extensions/ExtensionRegistryStub.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (C) 2010 Google Inc. All rights reserved.
 3 |  *
 4 |  * Redistribution and use in source and binary forms, with or without
 5 |  * modification, are permitted provided that the following conditions are
 6 |  * met:
 7 |  *
 8 |  *     * Redistributions of source code must retain the above copyright
 9 |  * notice, this list of conditions and the following disclaimer.
10 |  *     * Redistributions in binary form must reproduce the above
11 |  * copyright notice, this list of conditions and the following disclaimer
12 |  * in the documentation and/or other materials provided with the
13 |  * distribution.
14 |  *     * Neither the name of Google Inc. nor the names of its
15 |  * contributors may be used to endorse or promote products derived from
16 |  * this software without specific prior written permission.
17 |  *
18 |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 |  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 |  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 |  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 |  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 |  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 |  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 |  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 |  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 |  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |  */
30 | 
31 | if (!window.InspectorExtensionRegistry) {
32 | 
33 | /**
34 |  * @constructor
35 |  */
36 | WebInspector.InspectorExtensionRegistryStub = function()
37 | {
38 | }
39 | 
40 | WebInspector.InspectorExtensionRegistryStub.prototype = {
41 |     getExtensionsAsync: function()
42 |     {
43 |     }
44 | }
45 | 
46 | var InspectorExtensionRegistry = new WebInspector.InspectorExtensionRegistryStub();
47 | 
48 | }
49 | 


--------------------------------------------------------------------------------
/front-end/extensions/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": [
 3 |         "components"
 4 |     ],
 5 |     "scripts": [
 6 |         "ExtensionAPI.js",
 7 |         "ExtensionAuditCategory.js",
 8 |         "ExtensionRegistryStub.js",
 9 |         "ExtensionServer.js",
10 |         "ExtensionPanel.js",
11 |         "ExtensionView.js"
12 |     ]
13 | }
14 | 


--------------------------------------------------------------------------------
/front-end/heap_snapshot_worker/HeapSnapshotWorker.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (C) 2011 Google Inc. All rights reserved.
 3 |  *
 4 |  * Redistribution and use in source and binary forms, with or without
 5 |  * modification, are permitted provided that the following conditions are
 6 |  * met:
 7 |  *
 8 |  *     * Redistributions of source code must retain the above copyright
 9 |  * notice, this list of conditions and the following disclaimer.
10 |  *     * Redistributions in binary form must reproduce the above
11 |  * copyright notice, this list of conditions and the following disclaimer
12 |  * in the documentation and/or other materials provided with the
13 |  * distribution.
14 |  *     * Neither the name of Google Inc. nor the names of its
15 |  * contributors may be used to endorse or promote products derived from
16 |  * this software without specific prior written permission.
17 |  *
18 |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 |  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 |  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 |  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 |  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 |  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 |  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 |  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 |  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 |  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |  */
30 | 
31 | function postMessageWrapper(message)
32 | {
33 |     postMessage(message);
34 | }
35 | 
36 | var dispatcher = new WebInspector.HeapSnapshotWorkerDispatcher(this, postMessageWrapper);
37 | 
38 | /**
39 |  * @param {function(!Event)} listener
40 |  * @suppressGlobalPropertiesCheck
41 |  */
42 | function installMessageEventListener(listener)
43 | {
44 |     self.addEventListener("message", listener, false);
45 | }
46 | 
47 | installMessageEventListener(dispatcher.dispatchMessage.bind(dispatcher));
48 | 


--------------------------------------------------------------------------------
/front-end/heap_snapshot_worker/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "scripts": [
 3 |         "../platform/Promise.js",
 4 |         "../platform/utilities.js",
 5 |         "../common/WebInspector.js",
 6 |         "../common/UIString.js",
 7 |         "../common/TextUtils.js",
 8 |         "../profiler/HeapSnapshotCommon.js",
 9 |         "AllocationProfile.js",
10 |         "HeapSnapshot.js",
11 |         "HeapSnapshotLoader.js",
12 |         "HeapSnapshotWorkerDispatcher.js",
13 |         "JSHeapSnapshot.js",
14 |         "HeapSnapshotWorker.js"
15 |     ]
16 | }
17 | 


--------------------------------------------------------------------------------
/front-end/host/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": [
 3 |         "common",
 4 |         "platform"
 5 |     ],
 6 |     "scripts": [
 7 |         "InspectorFrontendHost.js",
 8 |         "Platform.js",
 9 |         "UserMetrics.js"
10 |     ]
11 | }
12 | 


--------------------------------------------------------------------------------
/front-end/inspector.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | @import url("dialog.css");
 8 | @import url("inspectorStyle.css");
 9 | @import url("inspectorCommon.css");
10 | @import url("inspectorSyntaxHighlight.css");
11 | @import url("popover.css");
12 | @import url("sidebarPane.css");
13 | @import url("suggestBox.css");
14 | @import url("tabbedPane.css");
15 | 
16 | #sources-editor-container-tabbed-pane .tabbed-pane-content {
17 |     height: calc(100vh - 116px);
18 | }
19 | #console-messages {
20 | 
21 |     height: calc(100vh - 97px);
22 | }
23 | 


--------------------------------------------------------------------------------
/front-end/inspector.html:
--------------------------------------------------------------------------------
 1 | <!--
 2 |  * Copyright 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 | -->
 6 | <!doctype html>
 7 | <html>
 8 | <head>
 9 |     <meta http-equiv="content-type" content="text/html; charset=utf-8">
10 |     <meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' blob:">
11 |     <link rel="stylesheet" type="text/css" href="inspector.css">
12 |     <script type="text/javascript" src="Runtime.js"></script>
13 |     <script type="text/javascript" src="inspector.js"></script>
14 | </head>
15 | <body class="undocked" id="-blink-dev-tools"></body>
16 | </html>
17 | 


--------------------------------------------------------------------------------
/front-end/inspector.js:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | 
5 | Runtime.startApplication("inspector");
6 | 


--------------------------------------------------------------------------------
/front-end/inspector.json:
--------------------------------------------------------------------------------
 1 | [
 2 |     { "name": "platform", "type": "autostart" },
 3 |     { "name": "main", "type": "autostart" },
 4 |     { "name": "components", "type": "autostart" },
 5 |     { "name": "ui", "type": "autostart" },
 6 |     { "name": "sdk", "type": "autostart" },
 7 |     { "name": "host", "type": "autostart" },
 8 |     { "name": "common", "type": "autostart" },
 9 |     { "name": "toolbox", "type": "autostart" },
10 |     { "name": "screencast", "type": "autostart" },
11 |     { "name": "workspace", "type": "autostart" },
12 |     { "name": "bindings", "type": "autostart" },
13 |     { "name": "extensions", "type": "autostart" },
14 |     { "name": "elements" },
15 |     { "name": "network" },
16 |     { "name": "sources" },
17 |     { "name": "timeline" },
18 |     { "name": "profiler" },
19 |     { "name": "resources" },
20 |     { "name": "audits" },
21 |     { "name": "console" },
22 |     { "name": "source_frame" },
23 |     { "name": "settings" },
24 |     { "name": "devices" },
25 |     { "name": "documentation" },
26 |     { "name": "layers" },
27 |     { "name": "promises" },
28 | 
29 |     { "name": "heap_snapshot_worker", "type": "worker" },
30 |     { "name": "script_formatter_worker", "type": "worker" },
31 |     { "name": "temp_storage_shared_worker", "type": "worker" }
32 | ]


--------------------------------------------------------------------------------
/front-end/layers/LayerPaintProfilerView.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @param {function(!WebInspector.Layer, string=)} showImageForLayerCallback
 8 |  * @extends {WebInspector.SplitView}
 9 |  */
10 | WebInspector.LayerPaintProfilerView = function(showImageForLayerCallback)
11 | {
12 |     WebInspector.SplitView.call(this, true, false);
13 | 
14 |     this._showImageForLayerCallback = showImageForLayerCallback;
15 |     this._logTreeView = new WebInspector.PaintProfilerCommandLogView();
16 |     this.setSidebarView(this._logTreeView);
17 |     this._paintProfilerView = new WebInspector.PaintProfilerView(this._showImage.bind(this));
18 |     this.setMainView(this._paintProfilerView);
19 | 
20 |     this._paintProfilerView.addEventListener(WebInspector.PaintProfilerView.Events.WindowChanged, this._onWindowChanged, this);
21 | }
22 | 
23 | WebInspector.LayerPaintProfilerView.prototype = {
24 |     /**
25 |      * @param {!WebInspector.Layer} layer
26 |      */
27 |     profileLayer: function(layer)
28 |     {
29 |         this._logTreeView.setCommandLog(null, []);
30 |         this._paintProfilerView.setSnapshotAndLog(null, []);
31 |         layer.requestSnapshot(onSnapshotDone.bind(this));
32 | 
33 |         /**
34 |          * @param {!WebInspector.PaintProfilerSnapshot=} snapshot
35 |          * @this {WebInspector.LayerPaintProfilerView}
36 |          */
37 |         function onSnapshotDone(snapshot)
38 |         {
39 |             this._layer = layer;
40 |             snapshot.commandLog(onCommandLogDone.bind(this, snapshot));
41 |         }
42 | 
43 |         /**
44 |          * @param {!WebInspector.PaintProfilerSnapshot=} snapshot
45 |          * @param {!Array.<!Object>=} log
46 |          * @this {WebInspector.LayerPaintProfilerView}
47 |          */
48 |         function onCommandLogDone(snapshot, log)
49 |         {
50 |             this._logTreeView.setCommandLog(snapshot.target(), log);
51 |             this._paintProfilerView.setSnapshotAndLog(snapshot || null, log || []);
52 |         }
53 |     },
54 | 
55 |     _onWindowChanged: function()
56 |     {
57 |         var window = this._paintProfilerView.windowBoundaries();
58 |         this._logTreeView.updateWindow(window.left, window.right);
59 |     },
60 | 
61 |     /**
62 |      * @param {string=} imageURL
63 |      */
64 |     _showImage: function(imageURL)
65 |     {
66 |         this._showImageForLayerCallback(this._layer, imageURL);
67 |     },
68 | 
69 |     __proto__: WebInspector.SplitView.prototype
70 | };
71 | 
72 | 


--------------------------------------------------------------------------------
/front-end/layers/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "@WebInspector.PanelFactory",
 5 |             "name": "layers",
 6 |             "title": "Layers",
 7 |             "order": 7,
 8 |             "className": "WebInspector.LayersPanelFactory"
 9 |         },
10 |         {
11 |             "type": "@WebInspector.Revealer",
12 |             "contextTypes": ["WebInspector.DeferredLayerTree"],
13 |             "className": "WebInspector.LayersPanel.LayerTreeRevealer"
14 |         }
15 |     ],
16 |     "dependencies": ["timeline"],
17 |     "experiment": "layersPanel",
18 |     "scripts": [
19 |         "LayerPaintProfilerView.js",
20 |         "LayersPanel.js"
21 |     ]
22 | }
23 | 


--------------------------------------------------------------------------------
/front-end/main/App.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  */
 8 | WebInspector.App = function()
 9 | {
10 | };
11 | 
12 | WebInspector.App.prototype = {
13 |     /**
14 |      * @param {!Document} document
15 |      */
16 |     presentUI: function(document)
17 |     {
18 |     }
19 | };
20 | 
21 | /**
22 |  * @type {!WebInspector.App}
23 |  */
24 | WebInspector.app;
25 | 


--------------------------------------------------------------------------------
/front-end/main/HelpScreenUntilReload.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (C) 2013 Google Inc. All rights reserved.
 3 |  *
 4 |  * Redistribution and use in source and binary forms, with or without
 5 |  * modification, are permitted provided that the following conditions are
 6 |  * met:
 7 |  *
 8 |  *     * Redistributions of source code must retain the above copyright
 9 |  * notice, this list of conditions and the following disclaimer.
10 |  *     * Redistributions in binary form must reproduce the above
11 |  * copyright notice, this list of conditions and the following disclaimer
12 |  * in the documentation and/or other materials provided with the
13 |  * distribution.
14 |  *     * Neither the name of Google Inc. nor the names of its
15 |  * contributors may be used to endorse or promote products derived from
16 |  * this software without specific prior written permission.
17 |  *
18 |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 |  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 |  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 |  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 |  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 |  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 |  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 |  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 |  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 |  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |  */
30 | 
31 | /**
32 |  * @constructor
33 |  * @param {string=} title
34 |  * @param {string=} message
35 |  * @extends {WebInspector.HelpScreen}
36 |  */
37 | WebInspector.HelpScreenUntilReload = function(title, message)
38 | {
39 |     WebInspector.HelpScreen.call(this, title);
40 |     var p = this.helpContentElement.createChild("p");
41 |     p.classList.add("help-section");
42 |     p.textContent = message;
43 |     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this.hide, this);
44 | }
45 | 
46 | WebInspector.HelpScreenUntilReload.prototype = {
47 |     /**
48 |      * @override
49 |      */
50 |     willHide: function()
51 |     {
52 |         WebInspector.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this.hide, this);
53 |         WebInspector.HelpScreen.prototype.willHide.call(this);
54 |     },
55 | 
56 |     __proto__: WebInspector.HelpScreen.prototype
57 | }
58 | 


--------------------------------------------------------------------------------
/front-end/main/SimpleApp.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @extends {WebInspector.App}
 8 |  */
 9 | WebInspector.SimpleApp = function()
10 | {
11 |     WebInspector.App.call(this);
12 | };
13 | 
14 | WebInspector.SimpleApp.prototype = {
15 |     /**
16 |      * @param {!Document} document
17 |      * @override
18 |      */
19 |     presentUI: function(document)
20 |     {
21 |         var rootView = new WebInspector.RootView();
22 |         WebInspector.inspectorView.show(rootView.element);
23 |         WebInspector.inspectorView.showInitialPanel();
24 |         rootView.attachToDocument(document);
25 |     },
26 | 
27 |     __proto__: WebInspector.App.prototype
28 | };
29 | 


--------------------------------------------------------------------------------
/front-end/main/TestController.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (C) 2009 Google Inc. All rights reserved.
 3 |  *
 4 |  * Redistribution and use in source and binary forms, with or without
 5 |  * modification, are permitted provided that the following conditions are
 6 |  * met:
 7 |  *
 8 |  *     * Redistributions of source code must retain the above copyright
 9 |  * notice, this list of conditions and the following disclaimer.
10 |  *     * Redistributions in binary form must reproduce the above
11 |  * copyright notice, this list of conditions and the following disclaimer
12 |  * in the documentation and/or other materials provided with the
13 |  * distribution.
14 |  *     * Neither the name of Google Inc. nor the names of its
15 |  * contributors may be used to endorse or promote products derived from
16 |  * this software without specific prior written permission.
17 |  *
18 |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 |  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 |  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 |  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 |  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 |  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 |  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 |  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 |  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 |  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |  */
30 | 
31 | WebInspector.evaluateForTestInFrontend = function(callId, script)
32 | {
33 |     if (!InspectorFrontendHost.isUnderTest())
34 |         return;
35 | 
36 |     function invokeMethod()
37 |     {
38 |         try {
39 |             script = script + "//# sourceURL=evaluateInWebInspector" + callId + ".js";
40 |             window.eval(script);
41 |         } catch (e) {
42 |         }
43 |     }
44 |     InspectorBackend.connection().runAfterPendingDispatches(invokeMethod);
45 | }
46 | 


--------------------------------------------------------------------------------
/front-end/network/RequestHTMLView.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (C) 2011 Google Inc. All rights reserved.
 3 |  *
 4 |  * Redistribution and use in source and binary forms, with or without
 5 |  * modification, are permitted provided that the following conditions are
 6 |  * met:
 7 |  *
 8 |  *     * Redistributions of source code must retain the above copyright
 9 |  * notice, this list of conditions and the following disclaimer.
10 |  *     * Redistributions in binary form must reproduce the above
11 |  * copyright notice, this list of conditions and the following disclaimer
12 |  * in the documentation and/or other materials provided with the
13 |  * distribution.
14 |  *     * Neither the name of Google Inc. nor the names of its
15 |  * contributors may be used to endorse or promote products derived from
16 |  * this software without specific prior written permission.
17 |  *
18 |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 |  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 |  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 |  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 |  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 |  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 |  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 |  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 |  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 |  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |  */
30 | 
31 | /**
32 |  * @constructor
33 |  * @extends {WebInspector.RequestView}
34 |  * @param {!WebInspector.NetworkRequest} request
35 |  * @param {string} dataURL
36 |  */
37 | WebInspector.RequestHTMLView = function(request, dataURL)
38 | {
39 |     WebInspector.RequestView.call(this, request);
40 |     this._dataURL = dataURL;
41 |     this.element.classList.add("html");
42 | }
43 | 
44 | WebInspector.RequestHTMLView.prototype = {
45 |     wasShown: function()
46 |     {
47 |         this._createIFrame();
48 |     },
49 | 
50 |     willHide: function(parentElement)
51 |     {
52 |         this.element.removeChildren();
53 |     },
54 | 
55 |     _createIFrame: function()
56 |     {
57 |         // We need to create iframe again each time because contentDocument
58 |         // is deleted when iframe is removed from its parent.
59 |         this.element.removeChildren();
60 |         var iframe = createElement("iframe");
61 |         iframe.setAttribute("sandbox", ""); // Forbid to run JavaScript and set unique origin.
62 |         iframe.setAttribute("src", this._dataURL);
63 |         this.element.appendChild(iframe);
64 |     },
65 | 
66 |     __proto__: WebInspector.RequestView.prototype
67 | }
68 | 


--------------------------------------------------------------------------------
/front-end/network/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "@WebInspector.PanelFactory",
 5 |             "name": "network",
 6 |             "title": "Network",
 7 |             "order": 1,
 8 |             "className": "WebInspector.NetworkPanelFactory"
 9 |         },
10 |         {
11 |             "type": "@WebInspector.ContextMenu.Provider",
12 |             "contextTypes": ["WebInspector.NetworkRequest", "WebInspector.Resource", "WebInspector.UISourceCode"],
13 |             "className": "WebInspector.NetworkPanel.ContextMenuProvider"
14 |         },
15 |         {
16 |             "type": "@WebInspector.Revealer",
17 |             "contextTypes": ["WebInspector.NetworkRequest"],
18 |             "className": "WebInspector.NetworkPanel.RequestRevealer"
19 |         }
20 |     ],
21 |     "dependencies": ["source_frame"],
22 |     "scripts": [
23 |         "FilterSuggestionBuilder.js",
24 |         "HARWriter.js",
25 |         "RequestView.js",
26 |         "NetworkDataGridNode.js",
27 |         "NetworkItemView.js",
28 |         "NetworkTimeCalculator.js",
29 |         "NetworkLogView.js",
30 |         "RequestCookiesView.js",
31 |         "RequestHeadersView.js",
32 |         "RequestHTMLView.js",
33 |         "RequestJSONView.js",
34 |         "RequestPreviewView.js",
35 |         "RequestResponseView.js",
36 |         "RequestTimingView.js",
37 |         "ResourceWebSocketFrameView.js",
38 |         "NetworkPanel.js"
39 |     ],
40 |     "stylesheets": [
41 |         "networkLogView.css",
42 |         "networkPanel.css",
43 |         "requestCookiesView.css",
44 |         "requestHeadersView.css",
45 |         "webSocketFrameView.css"
46 |     ]
47 | }
48 | 


--------------------------------------------------------------------------------
/front-end/network/requestCookiesView.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | .request-cookies-view {
 8 |     display: none;
 9 |     position: absolute;
10 |     top: 0;
11 |     right: 0;
12 |     left: 0;
13 |     bottom: 0;
14 |     overflow: auto;
15 |     margin: 12px;
16 |     height: 100%;
17 | }
18 | 
19 | .request-cookies-view.visible {
20 |     display: flex;
21 | }
22 | 
23 | .request-cookies-view .data-grid {
24 |     flex: auto;
25 |     height: 100%;
26 | }
27 | 
28 | .request-cookies-view .data-grid .row-group {
29 |     font-weight: bold;
30 |     font-size: 11px;
31 | }
32 | 


--------------------------------------------------------------------------------
/front-end/network/requestHeadersView.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | .request-headers-view {
 8 |     display: none;
 9 |     margin: 6px;
10 |     -webkit-user-select: text;
11 |     position: absolute;
12 |     top: 0;
13 |     left: 0;
14 |     right: 0;
15 |     bottom: 0;
16 |     overflow: auto;
17 | }
18 | 
19 | .request-headers-view.visible {
20 |     display: block;
21 | }
22 | 
23 | .request-headers-view .outline-disclosure > .parent {
24 |     -webkit-user-select: none;
25 |     font-weight: bold;
26 | }
27 | 
28 | .request-headers-view .outline-disclosure > .parent > .section {
29 |     font-weight: normal;
30 | }
31 | 
32 | .request-headers-view .outline-disclosure .children li {
33 |     white-space: nowrap;
34 | }
35 | 
36 | .request-headers-view .outline-disclosure .caution {
37 |     margin-left: 4px;
38 |     display: inline-block;
39 |     font-weight: bold;
40 | }
41 | 
42 | .request-headers-view .outline-disclosure li.expanded .header-count {
43 |     display: none;
44 | }
45 | 
46 | .request-headers-view .outline-disclosure li .header-toggle {
47 |     display: none;
48 | }
49 | 
50 | .request-headers-view .outline-disclosure li .status-from-cache {
51 |     color: gray;
52 | }
53 | 
54 | .request-headers-view .outline-disclosure li.expanded .header-toggle {
55 |     display: inline;
56 |     margin-left: 30px;
57 |     font-weight: normal;
58 |     color: rgb(45%, 45%, 45%);
59 | }
60 | 
61 | .request-headers-view .outline-disclosure li .header-toggle:hover {
62 |     color: rgb(20%, 20%, 45%);
63 |     cursor: pointer;
64 | }
65 | 
66 | .request-headers-view .outline-disclosure .header-name {
67 |     color: rgb(33%, 33%, 33%);
68 |     display: inline-block;
69 |     margin-right: 0.5em;
70 |     font-weight: bold;
71 |     vertical-align: top;
72 |     white-space: pre-wrap;
73 | }
74 | 
75 | .request-headers-view .outline-disclosure .header-value {
76 |     display: inline;
77 |     margin-right: 1em;
78 |     white-space: pre-wrap;
79 |     word-break: break-all;
80 |     margin-top: 1px;
81 | }
82 | 
83 | .resource-status-image {
84 |     margin-top: -2px;
85 |     margin-right: 3px;
86 |     vertical-align: middle;
87 | }
88 | 


--------------------------------------------------------------------------------
/front-end/network/webSocketFrameView.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | .websocket-frame-view {
 8 |     -webkit-user-select: text;
 9 | }
10 | 
11 | .websocket-frame-view .data-grid {
12 |     flex: auto;
13 |     border: none;
14 | }
15 | 
16 | .websocket-frame-view .data-grid .data {
17 |     background-image: none;
18 | }
19 | 
20 | .websocket-frame-view-td {
21 |     border-bottom: 1px solid #ccc;
22 | }
23 | 
24 | .websocket-frame-view .data-grid tr.selected {
25 |     background-color: #def;
26 | }
27 | 
28 | .websocket-frame-view .data-grid td,
29 | .websocket-frame-view .data-grid th {
30 |     border-left-color: #ccc;
31 | }
32 | 
33 | .websocket-frame-view-row-outcoming {
34 |     background-color: rgb(226, 247, 218);
35 | }
36 | 
37 | .websocket-frame-view-row-opcode {
38 |     background-color: rgb(255, 255, 232);
39 |     color: rgb(170, 111, 71);
40 | }
41 | 
42 | .websocket-frame-view-row-error {
43 |     background-color: rgb(255, 237, 237);
44 |     color: rgb(182, 0, 0);
45 | }
46 | 


--------------------------------------------------------------------------------
/front-end/platform/Promise.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @param {string} error
 7 |  * @return {!Promise.<T>}
 8 |  * @template T
 9 |  */
10 | Promise.rejectWithError = function(error)
11 | {
12 |     return Promise.reject(new Error(error));
13 | }
14 | 
15 | /**
16 |  * @param {function((T|undefined))} callback
17 |  * @return {!Promise.<T>}
18 |  * @template T
19 |  */
20 | Promise.prototype.thenOrCatch = function(callback)
21 | {
22 |     return this.then(callback, reject.bind(this));
23 | 
24 |     /**
25 |      * @param {*} e
26 |      * @this {Promise}
27 |      */
28 |     function reject(e)
29 |     {
30 |         this._reportError(e);
31 |         callback(undefined);
32 |     }
33 | }
34 | 
35 | Promise.prototype.done = function()
36 | {
37 |     this.catchAndReport();
38 | }
39 | 
40 | /**
41 |  * @return {!Promise}
42 |  */
43 | Promise.prototype.catchAndReport = function()
44 | {
45 |     return this.catch(this._reportError.bind(this));
46 | }
47 | 
48 | /**
49 |  * @param {*} e
50 |  */
51 | Promise.prototype._reportError = function(e)
52 | {
53 |     if (e instanceof Error)
54 |         console.error(e.stack);
55 |     else
56 |         console.error(e);
57 | }
58 | 


--------------------------------------------------------------------------------
/front-end/platform/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": [
 3 |     ],
 4 |     "scripts": [
 5 |         "Promise.js",
 6 |         "utilities.js",
 7 |         "DOMExtension.js"
 8 |     ]
 9 | }
10 | 


--------------------------------------------------------------------------------
/front-end/popover.css:
--------------------------------------------------------------------------------
 1 | .popover-container {
 2 |     pointer-events: none;
 3 |     overflow: hidden;
 4 | }
 5 | 
 6 | .popover {
 7 |     position: absolute;
 8 |     -webkit-border-image: url(Images/popoverBackground.png) 25 25 25 25;
 9 |     border-width: 25px;
10 |     z-index: 600;
11 |     pointer-events: none;
12 | }
13 | 
14 | .popover .content {
15 |     position: absolute;
16 |     top: 0;
17 |     bottom: 0;
18 |     left: 0;
19 |     right: 0;
20 |     pointer-events: auto;
21 |     overflow: auto;
22 |     -webkit-user-select: text;
23 |     line-height: 11px;
24 | }
25 | 
26 | .popover .content.fixed-height {
27 |     overflow: hidden;
28 | } 
29 | 
30 | .popover .arrow {
31 |     position: absolute;
32 |     background-image: url(Images/popoverArrows.png);
33 |     width: 19px;
34 |     height: 19px;
35 |     margin-left: 15px;
36 |     margin-top: -24px;
37 |     top: 0;
38 |     left: 0;
39 | }
40 | 
41 | .popover.top-left-arrow .arrow {
42 |     /* The default is top-left, no styles needed. */
43 | }
44 | 
45 | .popover.top-right-arrow .arrow {
46 |     right: 24px;
47 |     left: auto;
48 | }
49 | 
50 | .popover.bottom-left-arrow .arrow {
51 |     top: auto;
52 |     bottom: 0;
53 |     margin-top: 0;
54 |     margin-bottom: -24px;
55 |     background-position: 0 -19px;
56 | }
57 | 
58 | .popover.bottom-right-arrow .arrow {
59 |     right: 15px;
60 |     left: auto;
61 |     top: auto;
62 |     bottom: 0;
63 |     margin-top: 0;
64 |     margin-bottom: -24px;
65 |     background-position: 0 -19px;
66 | }
67 | 


--------------------------------------------------------------------------------
/front-end/profiler/ProfileTypeRegistry.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  */
 8 | WebInspector.ProfileTypeRegistry = function()
 9 | {
10 |     this._profileTypes = [];
11 | 
12 |     this.cpuProfileType = new WebInspector.CPUProfileType();
13 |     this._addProfileType(this.cpuProfileType);
14 |     this.heapSnapshotProfileType = new WebInspector.HeapSnapshotProfileType();
15 |     this._addProfileType(this.heapSnapshotProfileType);
16 |     this.trackingHeapSnapshotProfileType = new WebInspector.TrackingHeapSnapshotProfileType();
17 |     this._addProfileType(this.trackingHeapSnapshotProfileType);
18 | 
19 |     if (!WebInspector.isWorkerFrontend() && Runtime.experiments.isEnabled("canvasInspection")) {
20 |         this.canvasProfileType = new WebInspector.CanvasProfileType();
21 |         this._addProfileType(this.canvasProfileType);
22 |     }
23 | }
24 | 
25 | WebInspector.ProfileTypeRegistry.prototype = {
26 |     /**
27 |      * @param {!WebInspector.ProfileType} profileType
28 |      */
29 |     _addProfileType: function(profileType)
30 |     {
31 |         this._profileTypes.push(profileType);
32 |     },
33 | 
34 |     /**
35 |      * @return {!Array.<!WebInspector.ProfileType>}
36 |      */
37 |     profileTypes: function()
38 |     {
39 |         return this._profileTypes;
40 |     }
41 | }
42 | 
43 | WebInspector.ProfileTypeRegistry.instance = new WebInspector.ProfileTypeRegistry();
44 | 


--------------------------------------------------------------------------------
/front-end/profiler/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "@WebInspector.PanelFactory",
 5 |             "name": "profiles",
 6 |             "title": "Profiles",
 7 |             "order": 4,
 8 |             "className": "WebInspector.ProfilesPanelFactory"
 9 |         },
10 |         {
11 |             "type": "@WebInspector.ContextMenu.Provider",
12 |             "contextTypes": ["WebInspector.RemoteObject"],
13 |             "className": "WebInspector.ProfilesPanel.ContextMenuProvider"
14 |         },
15 |         {
16 |             "type": "ui-setting",
17 |             "section": "Profiler",
18 |             "title": "Show advanced heap snapshot properties",
19 |             "settingName": "showAdvancedHeapSnapshotProperties",
20 |             "settingType": "checkbox"
21 |         },
22 |         {
23 |             "type": "ui-setting",
24 |             "section": "Profiler",
25 |             "title": "Record heap allocation stack traces",
26 |             "settingName": "recordAllocationStacks",
27 |             "settingType": "checkbox"
28 |         },
29 |         {
30 |             "type": "ui-setting",
31 |             "section": "Profiler",
32 |             "title": "High resolution CPU profiling",
33 |             "settingName": "highResolutionCpuProfiling",
34 |             "settingType": "checkbox"
35 |         }
36 |     ],
37 |     "dependencies": [
38 |         "components"
39 |     ],
40 |     "scripts": [
41 |         "ProfilesPanel.js",
42 |         "CPUProfileDataGrid.js",
43 |         "CPUProfileBottomUpDataGrid.js",
44 |         "CPUProfileTopDownDataGrid.js",
45 |         "CPUProfileFlameChart.js",
46 |         "CPUProfileView.js",
47 |         "HeapSnapshotCommon.js",
48 |         "HeapSnapshotProxy.js",
49 |         "HeapSnapshotDataGrids.js",
50 |         "HeapSnapshotGridNodes.js",
51 |         "HeapSnapshotView.js",
52 |         "ProfileLauncherView.js",
53 |         "CanvasProfileView.js",
54 |         "CanvasReplayStateView.js",
55 |         "ProfileTypeRegistry.js"
56 |     ],
57 |     "stylesheets": [
58 |         "canvasProfiler.css",
59 |         "heapProfiler.css",
60 |         "profilesPanel.css"
61 |     ]
62 | }
63 | 


--------------------------------------------------------------------------------
/front-end/promises/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "drawer-view",
 5 |             "name": "promises",
 6 |             "title": "Promises",
 7 |             "order": "30",
 8 |             "className": "WebInspector.PromisePane"
 9 |         }
10 |     ],
11 |     "dependencies": [
12 |         "bindings",
13 |         "platform",
14 |         "ui"
15 |     ],
16 |     "experiment": "promiseTracker",
17 |     "scripts": [
18 |         "PromisePane.js"
19 |     ],
20 |     "stylesheets": [
21 |         "promisePane.css"
22 |     ]
23 | }
24 | 


--------------------------------------------------------------------------------
/front-end/promises/promisePane.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | .promises .data-grid {
 8 |     border: none;
 9 |     flex: 1 1;
10 | }
11 | 
12 | .promises .data-grid .odd {
13 |     background-color: #eee;
14 | }
15 | 
16 | .promises .data-grid .header-container {
17 |     height: 30px;
18 | }
19 | 
20 | .promises .data-grid .data-container {
21 |     top: 30px;
22 | }
23 | 
24 | .promises .data-grid table.data {
25 |     background: transparent;
26 | }
27 | 
28 | .promises .data-grid th {
29 |     border-bottom: none;
30 |     border-left: 1px solid rgb(205, 205, 205);
31 |     background-color: white;
32 | }
33 | 
34 | .promises .data-grid td {
35 |     line-height: 17px;
36 |     height: 24px;
37 |     vertical-align: middle;
38 |     border-bottom: 1px solid rgb(205, 205, 205);
39 |     border-left: 1px solid rgb(205, 205, 205);
40 | }
41 | 
42 | .promises .status {
43 |     border-radius: 25px;
44 |     width: 54px;
45 |     text-align: center;
46 |     color: white;
47 | }
48 | 
49 | .promises .status.rejected {
50 |     background-color: #f66;
51 | }
52 | 
53 | .promises .status.resolved {
54 |     background-color: #696;
55 | }


--------------------------------------------------------------------------------
/front-end/resources/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "@WebInspector.PanelFactory",
 5 |             "name": "resources",
 6 |             "title": "Resources",
 7 |             "order": 5,
 8 |             "className": "WebInspector.ResourcesPanelFactory"
 9 |         },
10 |         {
11 |             "type": "@WebInspector.Revealer",
12 |             "contextTypes": ["WebInspector.Resource"],
13 |             "className": "WebInspector.ResourcesPanel.ResourceRevealer"
14 |         }
15 |     ],
16 |     "dependencies": ["source_frame"],
17 |     "scripts": [
18 |         "ApplicationCacheItemsView.js",
19 |         "CookieItemsView.js",
20 |         "DOMStorageItemsView.js",
21 |         "DatabaseQueryView.js",
22 |         "DatabaseTableView.js",
23 |         "DirectoryContentView.js",
24 |         "IndexedDBViews.js",
25 |         "FileContentView.js",
26 |         "FileSystemView.js",
27 |         "ResourcesPanel.js"
28 |     ],
29 |     "stylesheets": [
30 |         "indexedDBViews.css",
31 |         "resourcesPanel.css"
32 |     ]
33 | }
34 | 


--------------------------------------------------------------------------------
/front-end/screencast/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": [
 3 |         "components"
 4 |     ],
 5 |     "scripts": [
 6 |         "ScreencastView.js"
 7 |     ],
 8 |     "stylesheets": [
 9 |         "screencastView.css"
10 |     ]
11 | }
12 | 


--------------------------------------------------------------------------------
/front-end/script_formatter_worker/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "scripts": [
 3 |         "../platform/Promise.js",
 4 |         "../platform/utilities.js",
 5 |         "../cm/headlesscodemirror.js",
 6 |         "../cm/css.js",
 7 |         "../cm/javascript.js",
 8 |         "../cm/xml.js",
 9 |         "../cm/htmlmixed.js",
10 |         "ScriptFormatterWorker.js",
11 |         "../UglifyJS/parse-js.js",
12 |         "JavaScriptFormatter.js",
13 |         "CSSFormatter.js"
14 |     ],
15 |     "skip_compilation": [
16 |         "../cm/headlesscodemirror.js",
17 |         "../cm/css.js",
18 |         "../cm/javascript.js",
19 |         "../cm/xml.js",
20 |         "../cm/htmlmixed.js",
21 |         "../UglifyJS/parse-js.js"
22 |     ]
23 | }
24 | 


--------------------------------------------------------------------------------
/front-end/sdk/PowerProfiler.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @extends {WebInspector.Object}
 8 |  * @param {!WebInspector.Target} target
 9 |  */
10 | WebInspector.PowerProfiler = function(target)
11 | {
12 |     WebInspector.Object.call(this);
13 |     this._dispatcher = new WebInspector.PowerDispatcher(this);
14 |     this._target = target;
15 |     target.registerPowerDispatcher(this._dispatcher);
16 |     target.powerAgent().getAccuracyLevel(this._onAccuracyLevel.bind(this));
17 | }
18 | 
19 | WebInspector.PowerProfiler.EventTypes = {
20 |     PowerEventRecorded: "PowerEventRecorded"
21 | }
22 | 
23 | WebInspector.PowerProfiler.prototype = {
24 |     startProfile: function ()
25 |     {
26 |         this._target.powerAgent().start();
27 |     },
28 | 
29 |     stopProfile: function ()
30 |     {
31 |         this._target.powerAgent().end();
32 |     },
33 | 
34 |     /**
35 |      * @return {string}
36 |      */
37 |     getAccuracyLevel: function()
38 |     {
39 |         return this._accuracyLevel;
40 |     },
41 | 
42 |     _onAccuracyLevel: function(error, result) {
43 |         this._accuracyLevel = "";
44 |         if (error) {
45 |             console.log("Unable to retrieve PowerProfiler accuracy level: " + error);
46 |             return;
47 |         }
48 |         this._accuracyLevel = result;
49 |     },
50 | 
51 |     __proto__: WebInspector.Object.prototype
52 | }
53 | 
54 | /**
55 |  * @constructor
56 |  * @implements {PowerAgent.Dispatcher}
57 |  */
58 | WebInspector.PowerDispatcher = function(profiler)
59 | {
60 |     this._profiler = profiler;
61 | }
62 | 
63 | WebInspector.PowerDispatcher.prototype = {
64 |     dataAvailable: function(events)
65 |     {
66 |         for (var i = 0; i < events.length; ++i)
67 |             this._profiler.dispatchEventToListeners(WebInspector.PowerProfiler.EventTypes.PowerEventRecorded, events[i]);
68 |     }
69 | }
70 | 
71 | /**
72 |  * @type {!WebInspector.PowerProfiler}
73 |  */
74 | WebInspector.powerProfiler;
75 | 


--------------------------------------------------------------------------------
/front-end/sdk/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": [
 3 |         "common",
 4 |         "host",
 5 |         "platform"
 6 |     ],
 7 |     "scripts": [
 8 |         "InspectorBackend.js",
 9 |         "../InspectorBackendCommands.js",
10 |         "Target.js",
11 |         "AnimationModel.js",
12 |         "ApplicationCacheModel.js",
13 |         "BlackboxSupport.js",
14 |         "ConsoleModel.js",
15 |         "ContentProviders.js",
16 |         "CookieParser.js",
17 |         "CPUProfileDataModel.js",
18 |         "CPUProfilerModel.js",
19 |         "CSSMetadata.js",
20 |         "CSSParser.js",
21 |         "CSSStyleModel.js",
22 |         "DOMModel.js",
23 |         "DOMStorage.js",
24 |         "Database.js",
25 |         "DebuggerModel.js",
26 |         "FileSystemModel.js",
27 |         "HAREntry.js",
28 |         "IndexedDBModel.js",
29 |         "LayerTreeModel.js",
30 |         "NetworkLog.js",
31 |         "OverridesSupport.js",
32 |         "PowerProfiler.js",
33 |         "TracingManager.js",
34 |         "WorkerManager.js",
35 |         "WorkerTargetManager.js",
36 |         "RuntimeModel.js",
37 |         "Script.js",
38 |         "SnippetStorage.js",
39 |         "RemoteObject.js",
40 |         "Resource.js",
41 |         "ResourceTreeModel.js",
42 |         "SourceMap.js",
43 |         "NetworkManager.js",
44 |         "NetworkRequest.js",
45 |         "PaintProfiler.js",
46 |         "HeapProfilerModel.js",
47 |         "../SupportedCSSProperties.js"
48 |     ],
49 |     "skip_compilation": [
50 |         "../InspectorBackendCommands.js",
51 |         "../SupportedCSSProperties.js"
52 |     ]
53 | }
54 | 


--------------------------------------------------------------------------------
/front-end/settings/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "@WebInspector.ActionDelegate",
 5 |             "actionId": "settings.show",
 6 |             "className": "WebInspector.SettingsController.SettingsScreenActionDelegate",
 7 |             "bindings": [
 8 |                 {
 9 |                     "shortcut": "F1 Shift+?"
10 |                 }
11 |             ]
12 |         },
13 |         {
14 |             "type": "@WebInspector.StatusBarItem.Provider",
15 |             "actionId": "settings.show",
16 |             "location": "toolbar-right",
17 |             "title": "Settings",
18 |             "order": 3,
19 |             "elementClass": "settings-status-bar-item"
20 |         },
21 |         {
22 |             "type": "ui-setting",
23 |             "section": "Sources",
24 |             "settingType": "custom",
25 |             "className": "WebInspector.SettingsScreen.SkipStackFramePatternSettingDelegate"
26 |         }
27 |     ],
28 |     "dependencies": [
29 |         "components"
30 |     ],
31 |     "scripts": [
32 |         "EditFileSystemDialog.js",
33 |         "FrameworkBlackboxDialog.js",
34 |         "SettingsScreen.js"
35 |     ]
36 | }
37 | 


--------------------------------------------------------------------------------
/front-end/source_frame/fontView.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | .font-view {
 8 |     font-size: 60px;
 9 |     white-space: pre-wrap;
10 |     word-wrap: break-word;
11 |     text-align: center;
12 |     padding: 15px;
13 | }
14 | 


--------------------------------------------------------------------------------
/front-end/source_frame/imageView.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | .image-view {
 8 |     overflow: auto;
 9 | }
10 | 
11 | .image-view > * {
12 |     flex: none;
13 | }
14 | 
15 | .image-view > .image {
16 |     padding: 20px 20px 10px 20px;
17 |     text-align: center;
18 | }
19 | 
20 | .image-view > .info {
21 |     padding-bottom: 10px;
22 |     font-size: 11px;
23 |     -webkit-user-select: text;
24 | }
25 | 
26 | .image-view img.resource-image-view {
27 |     max-width: 100%;
28 |     max-height: 1000px;
29 |     background-image: url(Images/checker.png);
30 |     box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
31 |     -webkit-user-select: text;
32 |     -webkit-user-drag: auto;
33 | }
34 | 
35 | .image-view .title {
36 |     text-align: center;
37 |     font-size: 13px;
38 | }
39 | 
40 | .image-view .infoList {
41 |     margin: 0;
42 | }
43 | 
44 | .image-view .infoList dt {
45 |     font-weight: bold;
46 |     display: inline-block;
47 |     width: 50%;
48 |     text-align: right;
49 |     color: rgb(76, 76, 76);
50 | }
51 | 
52 | .image-view .infoList dd {
53 |     display: inline-block;
54 |     padding-left: 8px;
55 |     width: 50%;
56 |     text-align: left;
57 |     margin: 0;
58 | }
59 | 
60 | .image-view .infoList dd::after {
61 |     white-space: pre;
62 |     content: "\A";
63 | }
64 | 


--------------------------------------------------------------------------------
/front-end/source_frame/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "@WebInspector.InplaceEditor",
 5 |             "className": "WebInspector.CodeMirrorUtils"
 6 |         },
 7 |         {
 8 |             "type": "@WebInspector.TokenizerFactory",
 9 |             "className": "WebInspector.CodeMirrorUtils.TokenizerFactory"
10 |         },
11 |         {
12 |             "type": "ui-setting",
13 |             "section": "Sources",
14 |             "title": "Default indentation:",
15 |             "settingName": "textEditorIndent",
16 |             "settingType": "select",
17 |             "options": [
18 |                 ["2 spaces", "  "],
19 |                 ["4 spaces", "    "],
20 |                 ["8 spaces", "        "],
21 |                 ["Tab character", "\t"]
22 |             ]
23 |         }
24 |     ],
25 |     "dependencies": [
26 |         "components"
27 |     ],
28 |     "scripts": [
29 |         "../cm/codemirror.js",
30 |         "../cm/css.js",
31 |         "../cm/javascript.js",
32 |         "../cm/xml.js",
33 |         "../cm/htmlmixed.js",
34 | 
35 |         "../cm/matchbrackets.js",
36 |         "../cm/closebrackets.js",
37 |         "../cm/markselection.js",
38 |         "../cm/comment.js",
39 |         "../cm/overlay.js",
40 | 
41 |         "../cm/htmlembedded.js",
42 |         "../cm/clike.js",
43 |         "../cm/coffeescript.js",
44 |         "../cm/php.js",
45 |         "../cm/python.js",
46 |         "../cm/shell.js",
47 |         "CodeMirrorUtils.js",
48 |         "CodeMirrorTextEditor.js",
49 |         "FontView.js",
50 |         "ImageView.js",
51 |         "SourceFrame.js",
52 |         "GoToLineDialog.js",
53 |         "ResourceSourceFrame.js"
54 |     ],
55 |     "skip_compilation": [
56 |         "../cm/codemirror.js",
57 |         "../cm/css.js",
58 |         "../cm/javascript.js",
59 |         "../cm/xml.js",
60 |         "../cm/htmlmixed.js",
61 | 
62 |         "../cm/matchbrackets.js",
63 |         "../cm/closebrackets.js",
64 |         "../cm/markselection.js",
65 |         "../cm/comment.js",
66 |         "../cm/overlay.js",
67 | 
68 |         "../cm/htmlembedded.js",
69 |         "../cm/clike.js",
70 |         "../cm/coffeescript.js",
71 |         "../cm/php.js",
72 |         "../cm/python.js",
73 |         "../cm/shell.js"
74 |     ],
75 |     "stylesheets": [
76 |         "../cm/codemirror.css",
77 |         "cmdevtools.css",
78 |         "fontView.css",
79 |         "imageView.css",
80 |         "resourceSourceFrame.css"
81 |     ]
82 | }
83 | 


--------------------------------------------------------------------------------
/front-end/source_frame/resourceSourceFrame.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | .resource-source-frame-fallback {
 8 |     background-color: #eee;
 9 |     word-wrap: break-word;
10 |     white-space: pre-wrap;
11 |     -webkit-user-select: text;
12 |     overflow: auto;
13 | }
14 | 


--------------------------------------------------------------------------------
/front-end/sources/AddSourceMapURLDialog.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @extends {WebInspector.DialogDelegate}
 8 |  * @param {function(string)} callback
 9 |  */
10 | WebInspector.AddSourceMapURLDialog = function(callback)
11 | {
12 |     WebInspector.DialogDelegate.call(this);
13 | 
14 |     this.element = createElementWithClass("div", "go-to-line-dialog");
15 |     this.element.createChild("label").textContent = WebInspector.UIString("Source map URL: ");
16 | 
17 |     this._input = this.element.createChild("input");
18 |     this._input.setAttribute("type", "text");
19 | 
20 |     this._goButton = this.element.createChild("button");
21 |     this._goButton.textContent = WebInspector.UIString("Go");
22 |     this._goButton.addEventListener("click", this._onGoClick.bind(this), false);
23 | 
24 |     this._callback = callback;
25 | }
26 | 
27 | /**
28 |  * @param {!Element} element
29 |  * @param {function(string)} callback
30 |  */
31 | WebInspector.AddSourceMapURLDialog.show = function(element, callback)
32 | {
33 |     WebInspector.Dialog.show(element, new WebInspector.AddSourceMapURLDialog(callback));
34 | }
35 | 
36 | WebInspector.AddSourceMapURLDialog.prototype = {
37 |     focus: function()
38 |     {
39 |         WebInspector.setCurrentFocusElement(this._input);
40 |         this._input.select();
41 |     },
42 | 
43 |     _onGoClick: function()
44 |     {
45 |         this._apply();
46 |         WebInspector.Dialog.hide();
47 |     },
48 | 
49 |     _apply: function()
50 |     {
51 |         var value = this._input.value;
52 |         this._callback(value);
53 |     },
54 | 
55 |     onEnter: function()
56 |     {
57 |         this._apply();
58 |     },
59 | 
60 |     __proto__: WebInspector.DialogDelegate.prototype
61 | }
62 | 


--------------------------------------------------------------------------------
/front-end/sources/filteredItemSelectionDialog.css:
--------------------------------------------------------------------------------
 1 | .filtered-item-list-dialog {
 2 |     display: flex;
 3 |     flex-direction: column;
 4 | }
 5 | 
 6 | .filtered-item-list-dialog > input[type=text] {
 7 |     flex: 0 0 36px;
 8 |     border: 0;
 9 |     box-shadow: rgba(140, 140, 140, 0.5) 0px 4px 16px;
10 |     margin: 0 !important;
11 |     padding-left: 6px !important;
12 |     z-index: 1;
13 | }
14 | 
15 | .filtered-item-list-dialog > div.container {
16 |     flex: auto;
17 |     overflow-y: auto;
18 |     margin-top: 4px;
19 |     background: white;
20 | }
21 | 
22 | .filtered-item-list-dialog-item {
23 |     padding: 6px;
24 |     white-space: nowrap;
25 |     text-overflow: ellipsis;
26 |     overflow: hidden;
27 |     color: rgb(95, 95, 95);
28 | }
29 | 
30 | .filtered-item-list-dialog-item.selected {
31 |     background-color: #eee;
32 | }
33 | 
34 | .filtered-item-list-dialog-item span.highlight {
35 |     color: #222;
36 |     font-weight: bold;
37 | }
38 | 
39 | .filtered-item-list-dialog-item .filtered-item-list-dialog-title {
40 |     flex: auto;
41 |     overflow: hidden;
42 |     text-overflow: ellipsis;
43 | }
44 | 
45 | .filtered-item-list-dialog-item .filtered-item-list-dialog-subtitle {
46 |     flex: none;
47 |     overflow: hidden;
48 |     text-overflow: ellipsis;
49 |     color: rgb(155, 155, 155);
50 | }
51 | 
52 | .filtered-item-list-dialog-item.one-row {
53 |     display: flex;
54 | }
55 | 
56 | .filtered-item-list-dialog-item.two-rows {
57 |     border-bottom: 1px solid rgb(235, 235, 235);
58 | }
59 | 


--------------------------------------------------------------------------------
/front-end/temp_storage_shared_worker/module.json:
--------------------------------------------------------------------------------
1 | {
2 |     "scripts": ["TempStorageSharedWorker.js"]
3 | }
4 | 


--------------------------------------------------------------------------------
/front-end/timeline/TimelinePowerGraph.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @extends {WebInspector.CountersGraph}
 8 |  * @implements {WebInspector.TimelineModeView}
 9 |  * @param {!WebInspector.TimelineModeViewDelegate} delegate
10 |  * @param {!WebInspector.TimelineModel} model
11 |  */
12 | WebInspector.TimelinePowerGraph = function(delegate, model)
13 | {
14 |     WebInspector.CountersGraph.call(this, WebInspector.UIString("POWER"), delegate, model);
15 | 
16 |     this._counter = this.createCounter(WebInspector.UIString("Power"), WebInspector.UIString("Power: %.2f\u2009watts"), "#d00");
17 |     WebInspector.powerProfiler.addEventListener(WebInspector.PowerProfiler.EventTypes.PowerEventRecorded, this._onRecordAdded, this);
18 | }
19 | 
20 | WebInspector.TimelinePowerGraph.prototype = {
21 |     dispose: function()
22 |     {
23 |         WebInspector.CountersGraph.prototype.dispose.call(this);
24 |         WebInspector.powerProfiler.removeEventListener(WebInspector.PowerProfiler.EventTypes.PowerEventRecorded, this._onRecordAdded, this);
25 |     },
26 | 
27 |     _onRecordAdded: function(event)
28 |     {
29 |         var record = event.data;
30 |         if (!this._previousRecord) {
31 |             this._previousRecord = record;
32 |             return;
33 |         }
34 | 
35 |         // "value" of original PowerEvent means the average power between previous sampling to current one.
36 |         // Here, it is converted to average power between current sampling to next one.
37 |         this._counter.appendSample(this._previousRecord.timestamp, record.value);
38 |         this._previousRecord = record;
39 |         this.scheduleRefresh();
40 |     },
41 | 
42 |     __proto__: WebInspector.CountersGraph.prototype
43 | }
44 | 


--------------------------------------------------------------------------------
/front-end/timeline/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "extensions": [
 3 |         {
 4 |             "type": "@WebInspector.PanelFactory",
 5 |             "name": "timeline",
 6 |             "title": "Timeline",
 7 |             "order": 3,
 8 |             "className": "WebInspector.TimelinePanelFactory"
 9 |         },
10 |         {
11 |             "type": "ui-setting",
12 |             "section": "Profiler",
13 |             "title": "Hide chrome frame in Layers view",
14 |             "settingName": "frameViewerHideChromeWindow",
15 |             "settingType": "checkbox"
16 |         }
17 |     ],
18 |     "dependencies": [
19 |         "components"
20 |     ],
21 |     "scripts": [
22 |         "CountersGraph.js",
23 |         "LayerDetailsView.js",
24 |         "LayerTreeOutline.js",
25 |         "Layers3DView.js",
26 |         "MemoryCountersGraph.js",
27 |         "TimelineModel.js",
28 |         "TimelineJSProfile.js",
29 |         "TimelineOverviewPane.js",
30 |         "TimelinePresentationModel.js",
31 |         "TimelineFrameModel.js",
32 |         "TimelineEventOverview.js",
33 |         "TimelineFrameOverview.js",
34 |         "TimelineMemoryOverview.js",
35 |         "TimelinePowerGraph.js",
36 |         "TimelinePowerOverview.js",
37 |         "TimelineFlameChart.js",
38 |         "TimelineUIUtils.js",
39 |         "TimelineView.js",
40 |         "TimelineLayersView.js",
41 |         "TimelinePaintProfilerView.js",
42 |         "TracingModel.js",
43 |         "TransformController.js",
44 |         "PaintProfilerView.js",
45 |         "TimelinePanel.js"
46 |     ],
47 |     "stylesheets": [
48 |         "timelinePanel.css"
49 |     ]
50 | }
51 | 


--------------------------------------------------------------------------------
/front-end/toolbox.css:
--------------------------------------------------------------------------------
1 | /*
2 |  * Copyright 2014 The Chromium Authors. All rights reserved.
3 |  * Use of this source code is governed by a BSD-style license that can be
4 |  * found in the LICENSE file.
5 |  */
6 | 
7 | @import url("inspectorStyle.css");
8 | @import url("inspectorCommon.css");
9 | 


--------------------------------------------------------------------------------
/front-end/toolbox.html:
--------------------------------------------------------------------------------
 1 | <!--
 2 |  * Copyright 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 | -->
 6 | <!doctype html>
 7 | <html>
 8 | <head>
 9 |     <meta http-equiv="content-type" content="text/html; charset=utf-8">
10 |     <meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval'">
11 |     <link rel="stylesheet" type="text/css" href="toolbox.css">
12 |     <script type="text/javascript" src="Runtime.js"></script>
13 |     <script type="text/javascript" src="toolbox.js"></script>
14 | </head>
15 | <body class="undocked" id="-blink-dev-tools"></body>
16 | </html>
17 | 


--------------------------------------------------------------------------------
/front-end/toolbox.js:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | 
5 | Runtime.startApplication("toolbox");
6 | 


--------------------------------------------------------------------------------
/front-end/toolbox.json:
--------------------------------------------------------------------------------
 1 | [
 2 |     {
 3 |         "name": "platform",
 4 |         "type": "autostart"
 5 |     },
 6 |     {
 7 |         "name": "toolbox_bootstrap",
 8 |         "type": "autostart"
 9 |     }
10 | ]
11 | 
12 | 


--------------------------------------------------------------------------------
/front-end/toolbox/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": [
 3 |         "bindings",
 4 |         "platform",
 5 |         "ui"
 6 |     ],
 7 |     "scripts": [
 8 |         "OverridesUI.js",
 9 |         "InspectedPagePlaceholder.js",
10 |         "MediaQueryInspector.js",
11 |         "ResponsiveDesignView.js"
12 |     ],
13 |     "stylesheets": [
14 |         "responsiveDesignView.css"
15 |     ]
16 | }
17 | 


--------------------------------------------------------------------------------
/front-end/toolbox_bootstrap/Toolbox.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | (function()
 6 | {
 7 | 
 8 | /**
 9 |  * @suppressGlobalPropertiesCheck
10 |  */
11 | function toolboxLoaded()
12 | {
13 |     if (!window.opener)
14 |         return;
15 |     window.opener.WebInspector["app"]["toolboxLoaded"](document);
16 | }
17 | 
18 | runOnWindowLoad(toolboxLoaded);
19 | 
20 | })();


--------------------------------------------------------------------------------
/front-end/toolbox_bootstrap/module.json:
--------------------------------------------------------------------------------
1 | {
2 |     "dependencies": [
3 |         "platform"
4 |     ],
5 |     "scripts": [
6 |         "Toolbox.js"
7 |     ]
8 | }
9 | 


--------------------------------------------------------------------------------
/front-end/ui/ActionRegistry.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  */
 8 | WebInspector.ActionRegistry = function()
 9 | {
10 |     /** @type {!Map.<string, !Runtime.Extension>} */
11 |     this._actionsById = new Map();
12 |     this._registerActions();
13 | }
14 | 
15 | WebInspector.ActionRegistry.prototype = {
16 |     _registerActions: function()
17 |     {
18 |         self.runtime.extensions(WebInspector.ActionDelegate).forEach(registerExtension, this);
19 | 
20 |         /**
21 |          * @param {!Runtime.Extension} extension
22 |          * @this {WebInspector.ActionRegistry}
23 |          */
24 |         function registerExtension(extension)
25 |         {
26 |             var actionId = extension.descriptor()["actionId"];
27 |             console.assert(actionId);
28 |             console.assert(!this._actionsById.get(actionId));
29 |             this._actionsById.set(actionId, extension);
30 |         }
31 |     },
32 | 
33 |     /**
34 |      * @param {!Array.<string>} actionIds
35 |      * @param {!WebInspector.Context} context
36 |      * @return {!Array.<string>}
37 |      */
38 |     applicableActions: function(actionIds, context)
39 |     {
40 |         var extensions = [];
41 |         actionIds.forEach(function(actionId) {
42 |            var extension = this._actionsById.get(actionId);
43 |            if (extension)
44 |                extensions.push(extension);
45 |         }, this);
46 |         return context.applicableExtensions(extensions).valuesArray().map(function(extension) {
47 |             return extension.descriptor()["actionId"];
48 |         });
49 |     },
50 | 
51 |     /**
52 |      * @param {string} actionId
53 |      * @return {!Promise.<boolean>}
54 |      */
55 |     execute: function(actionId)
56 |     {
57 |         var extension = this._actionsById.get(actionId);
58 |         console.assert(extension, "No action found for actionId '" + actionId + "'");
59 |         return extension.instancePromise().then(handleAction);
60 | 
61 |         /**
62 |          * @param {!Object} actionDelegate
63 |          * @return {boolean}
64 |          */
65 |         function handleAction(actionDelegate)
66 |         {
67 |             return /** @type {!WebInspector.ActionDelegate} */(actionDelegate).handleAction(WebInspector.context);
68 |         }
69 |     }
70 | }
71 | 
72 | /**
73 |  * @interface
74 |  */
75 | WebInspector.ActionDelegate = function()
76 | {
77 | }
78 | 
79 | WebInspector.ActionDelegate.prototype = {
80 |     /**
81 |      * @param {!WebInspector.Context} context
82 |      * @return {boolean} True if handled. Note that lazily loaded modules won't be able to consume
83 |      *                   platform events from their actions.
84 |      */
85 |     handleAction: function(context) {}
86 | }
87 | 
88 | /** @type {!WebInspector.ActionRegistry} */
89 | WebInspector.actionRegistry;
90 | 


--------------------------------------------------------------------------------
/front-end/ui/DropDownMenu.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @extends {WebInspector.Object}
 8 |  */
 9 | WebInspector.DropDownMenu = function()
10 | {
11 |     this.element = createElementWithClass("select", "drop-down-menu");
12 |     this.element.addEventListener("mousedown", this._onBeforeMouseDown.bind(this), true);
13 |     this.element.addEventListener("mousedown", consumeEvent, false);
14 |     this.element.addEventListener("change", this._onChange.bind(this), false);
15 | }
16 | 
17 | WebInspector.DropDownMenu.Events = {
18 |     BeforeShow: "BeforeShow",
19 |     ItemSelected: "ItemSelected"
20 | }
21 | 
22 | WebInspector.DropDownMenu.prototype = {
23 |     _onBeforeMouseDown: function()
24 |     {
25 |         this.dispatchEventToListeners(WebInspector.DropDownMenu.Events.BeforeShow, null);
26 |     },
27 | 
28 |     _onChange: function()
29 |     {
30 |         var options = this.element.options;
31 |         var selectedOption = options[this.element.selectedIndex];
32 |         this.dispatchEventToListeners(WebInspector.DropDownMenu.Events.ItemSelected, selectedOption.id);
33 |     },
34 | 
35 |     /**
36 |      * @param {string} id
37 |      * @param {string} title
38 |      */
39 |     addItem: function(id, title)
40 |     {
41 |         var option = new Option(title);
42 |         option.id = id;
43 |         this.element.appendChild(option);
44 |     },
45 | 
46 |     /**
47 |      * @param {?string} id
48 |      */
49 |     selectItem: function(id)
50 |     {
51 |         var children = this.element.children;
52 |         for (var i = 0; i < children.length; ++i) {
53 |             var child = children[i];
54 |             if (child.id === id) {
55 |                 this.element.selectedIndex = i;
56 |                 return;
57 |             }
58 |         }
59 |         this.element.selectedIndex = -1;
60 |     },
61 | 
62 |     clear: function()
63 |     {
64 |         this.element.removeChildren();
65 |     },
66 | 
67 |     __proto__: WebInspector.Object.prototype
68 | }
69 | 


--------------------------------------------------------------------------------
/front-end/ui/EmptyView.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (C) 2011 Google Inc. All rights reserved.
 3 |  *
 4 |  * Redistribution and use in source and binary forms, with or without
 5 |  * modification, are permitted provided that the following conditions are
 6 |  * met:
 7 |  *
 8 |  *     * Redistributions of source code must retain the above copyright
 9 |  * notice, this list of conditions and the following disclaimer.
10 |  *     * Redistributions in binary form must reproduce the above
11 |  * copyright notice, this list of conditions and the following disclaimer
12 |  * in the documentation and/or other materials provided with the
13 |  * distribution.
14 |  *     * Neither the name of Google Inc. nor the names of its
15 |  * contributors may be used to endorse or promote products derived from
16 |  * this software without specific prior written permission.
17 |  *
18 |  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 |  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 |  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 |  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 |  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 |  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 |  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 |  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 |  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 |  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |  */
30 | 
31 | /**
32 |  * @constructor
33 |  * @extends {WebInspector.VBox}
34 |  */
35 | WebInspector.EmptyView = function(text)
36 | {
37 |     WebInspector.VBox.call(this);
38 |     this._text = text;
39 | }
40 | 
41 | WebInspector.EmptyView.prototype = {
42 |     wasShown: function()
43 |     {
44 |         this.element.classList.add("empty-view");
45 |         this.element.textContent = this._text;
46 |     },
47 | 
48 |     set text(text)
49 |     {
50 |         this._text = text;
51 |         if (this.isShowing())
52 |             this.element.textContent = this._text;
53 |     },
54 | 
55 |     __proto__: WebInspector.VBox.prototype
56 | }
57 | 
58 | 


--------------------------------------------------------------------------------
/front-end/ui/ForwardedInputEventHandler.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  */
 8 | WebInspector.ForwardedInputEventHandler = function()
 9 | {
10 |     InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.KeyEventUnhandled, this._onKeyEventUnhandled, this);
11 | }
12 | 
13 | WebInspector.ForwardedInputEventHandler.prototype = {
14 |     /**
15 |      * @param {!WebInspector.Event} event
16 |      */
17 |     _onKeyEventUnhandled: function(event)
18 |     {
19 |         var data = event.data;
20 |         var type = /** @type {string} */ (data.type);
21 |         var keyIdentifier = /** @type {string} */ (data.keyIdentifier);
22 |         var keyCode = /** @type {number} */ (data.keyCode);
23 |         var modifiers =/** @type {number} */ (data.modifiers);
24 | 
25 |         if (type !== "keydown")
26 |             return;
27 | 
28 |         WebInspector.context.setFlavor(WebInspector.ShortcutRegistry.ForwardedShortcut, WebInspector.ShortcutRegistry.ForwardedShortcut.instance)
29 |         WebInspector.shortcutRegistry.handleKey(WebInspector.KeyboardShortcut.makeKey(keyCode, modifiers), keyIdentifier);
30 |         WebInspector.context.setFlavor(WebInspector.ShortcutRegistry.ForwardedShortcut, null);
31 |     }
32 | }
33 | 
34 | /** @type {!WebInspector.ForwardedInputEventHandler} */
35 | WebInspector.forwardedEventHandler = new WebInspector.ForwardedInputEventHandler();
36 | 


--------------------------------------------------------------------------------
/front-end/ui/RootView.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @extends {WebInspector.VBox}
 8 |  */
 9 | WebInspector.RootView = function()
10 | {
11 |     WebInspector.VBox.call(this);
12 |     this.markAsRoot();
13 |     this.element.classList.add("root-view");
14 |     this.element.setAttribute("spellcheck", false);
15 | }
16 | 
17 | WebInspector.RootView.prototype = {
18 |     /**
19 |      * @param {!Document} document
20 |      */
21 |     attachToDocument: function(document)
22 |     {
23 |         document.defaultView.addEventListener("resize", this.doResize.bind(this), false);
24 |         this._window = document.defaultView;
25 |         this.doResize();
26 |         this.show(document.body);
27 |     },
28 | 
29 |     doResize: function()
30 |     {
31 |         if (this._window) {
32 |             var size = this.constraints().minimum;
33 |             var zoom = WebInspector.zoomManager.zoomFactor();
34 |             var right = Math.min(0, this._window.innerWidth - size.width / zoom);
35 |             this.element.style.marginRight = right + "px";
36 |             var bottom = Math.min(0, this._window.innerHeight - size.height / zoom);
37 |             this.element.style.marginBottom = bottom + "px";
38 |         }
39 |         WebInspector.VBox.prototype.doResize.call(this);
40 |     },
41 | 
42 |     __proto__: WebInspector.VBox.prototype
43 | }
44 | 


--------------------------------------------------------------------------------
/front-end/ui/StackView.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (C) 2014 Google Inc. All rights reserved.
 3 |  *
 4 |  * Redistribution and use in source and binary forms, with or without
 5 |  * modification, are permitted provided that the following conditions are
 6 |  * met:
 7 |  *
 8 |  * 1. Redistributions of source code must retain the above copyright
 9 |  * notice, this list of conditions and the following disclaimer.
10 |  *
11 |  * 2. Redistributions in binary form must reproduce the above
12 |  * copyright notice, this list of conditions and the following disclaimer
13 |  * in the documentation and/or other materials provided with the
14 |  * distribution.
15 |  *
16 |  * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. AND ITS CONTRIBUTORS
17 |  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 |  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 |  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC.
20 |  * OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 |  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 |  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 |  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 |  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 |  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |  */
28 | 
29 | /**
30 |  * @constructor
31 |  * @extends {WebInspector.VBox}
32 |  * @param {boolean} isVertical
33 |  */
34 | WebInspector.StackView = function(isVertical)
35 | {
36 |     WebInspector.VBox.call(this);
37 |     this._isVertical = isVertical;
38 |     this._currentSplitView = null;
39 | }
40 | 
41 | WebInspector.StackView.prototype = {
42 |     /**
43 |      * @param {!WebInspector.View} view
44 |      * @param {string=} sidebarSizeSettingName
45 |      * @param {number=} defaultSidebarWidth
46 |      * @param {number=} defaultSidebarHeight
47 |      * @return {!WebInspector.SplitView}
48 |      */
49 |     appendView: function(view, sidebarSizeSettingName, defaultSidebarWidth, defaultSidebarHeight)
50 |     {
51 |         var splitView = new WebInspector.SplitView(this._isVertical, true, sidebarSizeSettingName, defaultSidebarWidth, defaultSidebarHeight);
52 |         splitView.setMainView(view);
53 |         splitView.hideSidebar();
54 | 
55 |         if (!this._currentSplitView) {
56 |             splitView.show(this.element);
57 |         } else {
58 |             this._currentSplitView.setSidebarView(splitView);
59 |             this._currentSplitView.showBoth();
60 |         }
61 | 
62 |         this._currentSplitView = splitView;
63 |         return splitView;
64 |     },
65 | 
66 |     detachChildViews: function()
67 |     {
68 |         WebInspector.View.prototype.detachChildViews.call(this);
69 |         this._currentSplitView = null;
70 |     },
71 | 
72 |     __proto__: WebInspector.VBox.prototype
73 | }
74 | 


--------------------------------------------------------------------------------
/front-end/ui/ZoomManager.js:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 The Chromium Authors. All rights reserved.
 2 | // Use of this source code is governed by a BSD-style license that can be
 3 | // found in the LICENSE file.
 4 | 
 5 | /**
 6 |  * @constructor
 7 |  * @extends {WebInspector.Object}
 8 |  * @param {!Window} window
 9 |  * @param {!InspectorFrontendHostAPI} frontendHost
10 |  */
11 | WebInspector.ZoomManager = function(window, frontendHost)
12 | {
13 |     this._frontendHost = frontendHost;
14 |     this._zoomFactor = this._frontendHost.zoomFactor();
15 |     window.addEventListener("resize", this._onWindowResize.bind(this), true);
16 | };
17 | 
18 | WebInspector.ZoomManager.Events = {
19 |     ZoomChanged: "ZoomChanged"
20 | };
21 | 
22 | WebInspector.ZoomManager.prototype = {
23 |     /**
24 |      * @return {number}
25 |      */
26 |     zoomFactor: function()
27 |     {
28 |         return this._zoomFactor;
29 |     },
30 | 
31 |     _onWindowResize: function()
32 |     {
33 |         var oldZoomFactor = this._zoomFactor;
34 |         this._zoomFactor = this._frontendHost.zoomFactor();
35 |         if (oldZoomFactor !== this._zoomFactor)
36 |             this.dispatchEventToListeners(WebInspector.ZoomManager.Events.ZoomChanged, {from: oldZoomFactor, to: this._zoomFactor});
37 |     },
38 | 
39 |     __proto__: WebInspector.Object.prototype
40 | };
41 | 
42 | /**
43 |  * @type {!WebInspector.ZoomManager}
44 |  */
45 | WebInspector.zoomManager;
46 | 


--------------------------------------------------------------------------------
/front-end/ui/flameChart.css:
--------------------------------------------------------------------------------
 1 | .flame-chart-main-pane {
 2 |     overflow: hidden;
 3 | }
 4 | 
 5 | .flame-chart-marker-highlight-element {
 6 |     position: absolute;
 7 |     top: 0;
 8 |     height: 20px;
 9 |     width: 4px;
10 |     margin: 0 -2px;
11 |     content: "";
12 |     display: block;
13 | }
14 | 
15 | .flame-chart-highlight-element {
16 |     background-color: black;
17 |     position: absolute;
18 |     opacity: 0.2;
19 |     pointer-events: none;
20 | }
21 | 
22 | .flame-chart-selected-element {
23 |     position: absolute;
24 |     pointer-events: none;
25 |     border-color: rgb(56, 121, 217);
26 |     border-width: 2px;
27 |     border-style: solid;
28 |     background-color: rgba(56, 121, 217, 0.2);
29 | }
30 | 
31 | .flame-chart-v-scroll {
32 |     flex: 0 0 14px;
33 |     overflow-x: hidden;
34 | }
35 | 
36 | .platform-mac .flame-chart-v-scroll {
37 |     position: absolute;
38 |     width: 14px;
39 |     top: 0;
40 |     right: 0;
41 |     bottom: 0;
42 | }
43 | 
44 | .flame-chart-selection-overlay {
45 |     position: absolute;
46 |     z-index: 100;
47 |     background-color: rgba(56, 121, 217, 0.3);
48 |     border-color: rgb(16, 81, 177);
49 |     border-width: 1px;
50 |     border-style: solid;
51 |     pointer-events:none;
52 | }
53 | 
54 | .flame-chart-selection-overlay .time-span {
55 |     white-space: nowrap;
56 | }
57 | 
58 | .flame-chart-entry-info {
59 |     position: absolute;
60 |     bottom: 20px;
61 |     left: 20px;
62 |     height: 120px;
63 |     background-color: rgba(255, 255, 255, 0.7);
64 |     pointer-events: none;
65 | }
66 | 


--------------------------------------------------------------------------------
/front-end/ui/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": [
 3 |         "platform",
 4 |         "common",
 5 |         "host"
 6 |     ],
 7 |     "scripts": [
 8 |         "View.js",
 9 |         "treeoutline.js",
10 |         "ActionRegistry.js",
11 |         "ShortcutRegistry.js",
12 |         "CompletionDictionary.js",
13 |         "Context.js",
14 |         "ContextMenu.js",
15 |         "DataGrid.js",
16 |         "Dialog.js",
17 |         "DOMSyntaxHighlighter.js",
18 |         "DropDownMenu.js",
19 |         "EmptyView.js",
20 |         "FilterBar.js",
21 |         "FlameChart.js",
22 |         "ForwardedInputEventHandler.js",
23 |         "HelpScreen.js",
24 |         "InplaceEditor.js",
25 |         "KeyboardShortcut.js",
26 |         "OverviewGrid.js",
27 |         "Panel.js",
28 |         "PieChart.js",
29 |         "Popover.js",
30 |         "ProgressIndicator.js",
31 |         "ResizerWidget.js",
32 |         "RootView.js",
33 |         "SearchableView.js",
34 |         "Section.js",
35 |         "SettingsUI.js",
36 |         "SidebarTreeElement.js",
37 |         "ShowMoreDataGridNode.js",
38 |         "SoftContextMenu.js",
39 |         "ViewportDataGrid.js",
40 |         "SortableDataGrid.js",
41 |         "SplitView.js",
42 |         "StackView.js",
43 |         "StatusBar.js",
44 |         "SuggestBox.js",
45 |         "TabbedPane.js",
46 |         "SidebarPane.js",
47 |         "TextEditor.js",
48 |         "TextPrompt.js",
49 |         "TimelineGrid.js",
50 |         "UIUtils.js",
51 |         "ViewportControl.js",
52 |         "ZoomManager.js"
53 |     ],
54 |     "stylesheets": [
55 |         "dataGrid.css",
56 |         "filter.css",
57 |         "flameChart.css",
58 |         "helpScreen.css",
59 |         "overviewGrid.css",
60 |         "panelEnablerView.css",
61 |         "pieChart.css",
62 |         "progressIndicator.css",
63 |         "searchableView.css",
64 |         "splitView.css",
65 |         "statusBar.css"
66 |     ]
67 | }
68 | 


--------------------------------------------------------------------------------
/front-end/ui/overviewGrid.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | .overview-grid-window-selector {
 8 |     position: absolute;
 9 |     top: 0;
10 |     bottom: 0;
11 |     background-color: rgba(125, 173, 217, 0.5);
12 |     z-index: 250;
13 |     pointer-events: none;
14 | }
15 | 
16 | .overview-grid-window {
17 |     background-color: white;
18 |     position: absolute;
19 |     left: 0;
20 |     right: 0;
21 |     top: 0;
22 |     height: 20px;
23 |     z-index: 150;
24 | }
25 | 
26 | .overview-grid-dividers-background {
27 |     left: 0%;
28 |     right: 0%;
29 |     top: 0;
30 |     height: 20px;
31 |     background-color: black;
32 |     position: absolute;
33 | }
34 | 
35 | .overview-grid-window-rulers {
36 |     top: 0;
37 |     bottom: 0;
38 |     position: absolute;
39 |     opacity: 0.2;
40 |     border-right: 1px solid black;
41 |     border-left: 1px solid black;
42 |     z-index: 250;
43 |     pointer-events: none;
44 | }
45 | 
46 | .overview-grid-window-resizer {
47 |     position: absolute;
48 |     top: 0;
49 |     height: 20px;
50 |     width: 5px;
51 |     margin-left: -2px;
52 |     margin-right: -3px;
53 |     background-color: rgb(153, 153, 153);
54 |     z-index: 500;
55 |     border-radius: 2px;
56 |     box-shadow: white 1px 0 0, white -1px 0 0, white 0 1px 0, white 0 -1px 0;
57 | }
58 | 
59 | .overview-grid-window-resizer-right {
60 |     margin-left: -3px;
61 |     margin-right: -2px;
62 | }
63 | 


--------------------------------------------------------------------------------
/front-end/ui/pieChart.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | .root {
 8 |     position: relative;
 9 |     width: 100%;
10 |     height: 100%;
11 | }
12 | 
13 | .pie-chart-foreground {
14 |     position: absolute;
15 |     width: 100%;
16 |     height: 100%;
17 |     z-index: 10;
18 |     top: 0;
19 |     display: flex;
20 | }
21 | 
22 | .pie-chart-total {
23 |     margin: auto;
24 |     padding: 2px 5px;
25 |     background-color: rgba(255, 255, 255, 0.6);
26 | }
27 | 


--------------------------------------------------------------------------------
/front-end/ui/progressIndicator.css:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2014 The Chromium Authors. All rights reserved.
 3 |  * Use of this source code is governed by a BSD-style license that can be
 4 |  * found in the LICENSE file.
 5 |  */
 6 | 
 7 | .progress-indicator-shadow-stop-button {
 8 |     background-color: rgb(216, 0, 0) !important;
 9 |     border: 0;
10 |     width: 12px;
11 |     height: 12px;
12 | }
13 | 
14 | .progress-indicator-shadow-container {
15 |     display: flex;
16 |     margin: 0 8px;
17 |     flex: 1 0 auto;
18 |     align-content: center;
19 |     justify-content: center;
20 | }
21 | 
22 | .progress-indicator-shadow-container span {
23 |     padding: 6px;
24 | }
25 | 
26 | .progress-indicator-shadow-container progress {
27 |     flex: auto;
28 |     margin: 0 4px;
29 | }
30 | 


--------------------------------------------------------------------------------
/front-end/workspace/module.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "dependencies": ["common", "host", "platform"],
 3 |     "scripts": [
 4 |         "FileManager.js",
 5 |         "FileSystemMapping.js",
 6 |         "FileSystemWorkspaceBinding.js",
 7 |         "IsolatedFileSystem.js",
 8 |         "IsolatedFileSystemManager.js",
 9 |         "SearchConfig.js",
10 |         "UISourceCode.js",
11 |         "Workspace.js"
12 |     ]
13 | }
14 | 


--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
 1 | // Public API for node-inspector embedders
 2 | var url = require('url');
 3 | var path = require('path');
 4 | 
 5 | exports.buildInspectorUrl = buildInspectorUrl;
 6 | exports.buildWebSocketUrl = buildWebSocketUrl;
 7 | 
 8 | /**
 9 |  * Build a URL for loading inspector UI in the browser.
10 |  * @param {string|undefined} inspectorHost as configured via --web-host
11 |  * @param {number} inspectorPort as configured via --web-port
12 |  * @param {number} debugPort as configured via --debug in the debugged app
13 |  * @param {number} isHttps as configured via --ssl-cert and --ssl-key in the debugged app
14 |  */
15 | function buildInspectorUrl(inspectorHost, inspectorPort, debugPort, isHttps) {
16 |   var host = inspectorHost == '0.0.0.0' ? '127.0.0.1' : inspectorHost;
17 |   var port = inspectorPort;
18 |   var protocol = isHttps ? 'https' : 'http';
19 | 
20 |   var isUnixSocket = !/^\d+$/.test(port);
21 |   if (isUnixSocket) {
22 |     host = path.resolve(__dirname, inspectorPort);
23 |     port = null;
24 |     protocol = 'unix';
25 |   }
26 | 
27 |   var parts = {
28 |     protocol: protocol,
29 |     hostname: host,
30 |     port: port,
31 |     pathname: '/',
32 |     search: '?port=' + debugPort
33 |   };
34 | 
35 |   return url.format(parts);
36 | }
37 | 
38 | /**
39 |  * Build a URL for the WebSocket endpoint.
40 |  * @param {string|undefined} inspectorHost as configured via --web-host
41 |  * @param {number} inspectorPort as configured via --web-port
42 |  * @param {number} debugPort as configured via --debug in the debugged app
43 |  * @param {number} isHttps as configured via --ssl-cert and --ssl-key in the debugged app
44 |  */
45 | function buildWebSocketUrl(inspectorHost, inspectorPort, debugPort, isSecure) {
46 |   var parts = {
47 |     protocol: isSecure ? 'wss:' : 'ws:',
48 |     hostname: inspectorHost == '0.0.0.0' ? '127.0.0.1' : inspectorHost,
49 |     port: inspectorPort,
50 |     pathname: '/',
51 |     search: '?port=' + debugPort,
52 |     slashes: true
53 |   };
54 | 
55 |   return url.format(parts);
56 | }
57 | 


--------------------------------------------------------------------------------
/lib/CallFramesProvider.js:
--------------------------------------------------------------------------------
 1 | var async = require('async'),
 2 |     convert = require('./convert.js');
 3 | 
 4 | var SCOPE_ID_MATCHER = /^scope:(\d+):(\d+)$/;
 5 | 
 6 | /**
 7 |  * @param {Object} config
 8 |  * @param {DebuggerClient} debuggerClient
 9 |  */
10 | function CallFramesProvider(config, session) {
11 |   this._config = config;
12 |   this._debuggerClient = session.debuggerClient;
13 | }
14 | 
15 | CallFramesProvider.prototype = {
16 | 
17 |   fetchCallFrames: function(handleResponse) {
18 |     this._debuggerClient.request(
19 |       'backtrace',
20 |       {
21 |         inlineRefs: true,
22 |         fromFrame: 0,
23 |         toFrame: this._config.stackTraceLimit
24 |       },
25 |       function(err, responseBody, responseRefs) {
26 |         if (err) {
27 |           handleResponse(err);
28 |           return;
29 |         }
30 | 
31 |         this._convertBacktraceToCallFrames(responseBody, responseRefs, handleResponse);
32 |       }.bind(this));
33 |   },
34 | 
35 |   _convertBacktraceToCallFrames: function(backtraceResponseBody, backtrackResponseRefs, handleResponse) {
36 |     var debuggerFrames = backtraceResponseBody.frames || [];
37 | 
38 |     async.map(
39 |       debuggerFrames,
40 |       this._convertDebuggerFrameToInspectorFrame.bind(this, backtrackResponseRefs),
41 |       handleResponse);
42 |   },
43 | 
44 |   _convertDebuggerFrameToInspectorFrame: function(backtrackResponseRefs, frame, done) {
45 |     var scopeChain = frame.scopes.map(function(scope) {
46 |       return {
47 |         object: {
48 |           type: 'object',
49 |           objectId: 'scope:' + frame.index + ':' + scope.index,
50 |           className: 'Object',
51 |           description: 'Object'
52 |         },
53 |         type: convert.v8ScopeTypeToString(scope.type)
54 |       };
55 |     });
56 | 
57 |     done(null, {
58 |       callFrameId: frame.index.toString(),
59 |       functionName: frame.func.inferredName || frame.func.name,
60 |       location: {
61 |         scriptId: convert.v8ScriptIdToInspectorId(frame.func.scriptId),
62 |         lineNumber: frame.line,
63 |         columnNumber: frame.column
64 |       },
65 |       scopeChain: scopeChain,
66 |       this: convert.v8RefToInspectorObject(frame.receiver)
67 |     });
68 |   },
69 | 
70 |   isScopeId: function(objectId) {
71 |     return SCOPE_ID_MATCHER.test(objectId);
72 |   },
73 | 
74 |   resolveScopeId: function(objectId, callback) {
75 |     var scopeIdMatch = SCOPE_ID_MATCHER.exec(objectId);
76 |     if (!scopeIdMatch) throw new Error('Invalid scope id "' + objectId + '"');
77 |     this._debuggerClient.request(
78 |       'scope',
79 |       {
80 |         number: Number(scopeIdMatch[2]),
81 |         frameNumber: Number(scopeIdMatch[1])
82 |       },
83 |       function(err, result) {
84 |         if (err)
85 |           callback(err);
86 |         else
87 |           callback(null, result.object.ref);
88 |       });
89 |   }
90 | };
91 | 
92 | exports.CallFramesProvider = CallFramesProvider;
93 | 


--------------------------------------------------------------------------------
/lib/ConsoleAgent.js:
--------------------------------------------------------------------------------
 1 | var convert = require('./convert');
 2 | 
 3 | var injection = require.resolve('./Injections/ConsoleAgent');
 4 | 
 5 | /**
 6 |  * @param {Object} config
 7 |  * @param {DebuggerClient} debuggerClient
 8 |  * @param {FrontendClient} frontendClient
 9 |  * @param {InjectorClient} injectorClient
10 |  * @param {ConsoleClient} consoleClient
11 |  * @constructor
12 |  */
13 | function ConsoleAgent(config, session) {
14 |   try {
15 |     this._noInject = config.inject === false || config.inject.console === false;
16 |   } catch (e) {
17 |     this._noInject = false;
18 |   }
19 | 
20 |   this._injected = false;
21 |   this._debuggerClient = session.debuggerClient;
22 |   this._frontendClient = session.frontendClient;
23 |   this._injectorClient = session.injectorClient;
24 |   this._consoleClient = session.consoleClient;
25 |   this._translateCommandToInjection(
26 |     'clearMessages'
27 |   );
28 | 
29 |   if (!this._noInject) this._injectorClient.on('inject', this._inject.bind(this));
30 | }
31 | 
32 | ConsoleAgent.prototype._inject = function() {
33 |   this._translateEventToFrontend(
34 |     'messageAdded',
35 |     'messagesCleared'
36 |   );
37 | 
38 |   this._injectorClient.injection(
39 |     function(require, debug, options) {
40 |       require(options.injection)(require, debug, options);
41 |     },
42 |     {
43 |       injection: injection
44 |     },
45 |     function(error, result) {
46 |       this._injected = !error;
47 | 
48 |       if (error) return this._frontendClient.sendLogToConsole('error', error.message || error);
49 |     }.bind(this)
50 |   );
51 | };
52 | 
53 | /**
54 |  * @param {...string} eventNames
55 | */
56 | ConsoleAgent.prototype._translateEventToFrontend = function(eventNames) {
57 |   Array.prototype.forEach.call(arguments, function(event) {
58 |     event = 'Console.' + event;
59 |     this._debuggerClient.on(event, function(message) {
60 |       if (event == 'Console.messageAdded') {
61 |         message.message.parameters = message.message.parameters.map(function(ref) {
62 |           this._consoleClient.convertHandleToConsoleHandle(ref, message.message.id);
63 |           return convert.v8ResultToInspectorResult(ref);
64 |         }, this);
65 |       }
66 |       this._frontendClient.sendEvent(event, message);
67 |     }.bind(this));
68 |   }, this);
69 | };
70 | 
71 | /**
72 |  * @param {...string} commandNames
73 | */
74 | ConsoleAgent.prototype._translateCommandToInjection = function(commandNames) {
75 |   Array.prototype.forEach.call(arguments, function(command) {
76 |     this[command] = function(params, done) {
77 |       this._debuggerClient.request('Console.' + command, params, done);
78 |     };
79 |   }, this);
80 | };
81 | 
82 | module.exports.ConsoleAgent = ConsoleAgent;
83 | 


--------------------------------------------------------------------------------
/lib/ConsoleClient.js:
--------------------------------------------------------------------------------
 1 | //console:messageId:refHandle
 2 | var CONSOLE_ID_MATCHER = /^console:(\d+):(\d+)$/;
 3 | 
 4 | function ConsoleClient(config, session) {
 5 |   this._debuggerClient = session.debuggerClient;
 6 |   this._frontendClient = session.frontendClient;
 7 | }
 8 | 
 9 | ConsoleClient.prototype.isConsoleId = function(objectId) {
10 |   return CONSOLE_ID_MATCHER.test(objectId);
11 | };
12 | 
13 | ConsoleClient.prototype.lookupConsoleId = function(objectId, done) {
14 |   var matchedId = CONSOLE_ID_MATCHER.exec(objectId);
15 |   var messageId = matchedId[1];
16 |   this._debuggerClient.request(
17 |     'Console._lookupConsoleId', 
18 |     { 
19 |       messageId: messageId,
20 |       objectId: matchedId[2]
21 |     },
22 |     function(error, lookupBody, lookupRefs) {
23 |       if (error) return done(error);
24 |       
25 |       Object.keys(lookupRefs).forEach(function(key) {
26 |         this.convertHandleToConsoleHandle(lookupRefs[key], messageId);
27 |       }, this);
28 |       done(null, lookupBody, lookupRefs);
29 |     }.bind(this)
30 |   );
31 | };
32 | 
33 | ConsoleClient.prototype.convertHandleToConsoleHandle = function(ref, messageId) {
34 |   if (ref.handle !== undefined) {
35 |     ref.handle = 'console:' + messageId + ':' + ref.handle;
36 |   }
37 | };
38 | 
39 | exports.ConsoleClient = ConsoleClient;
40 | 


--------------------------------------------------------------------------------
/lib/HeapProfilerAgent.js:
--------------------------------------------------------------------------------
 1 | var convert = require('./convert');
 2 | 
 3 | var injection = require.resolve('./Injections/HeapProfilerAgent');
 4 | 
 5 | /**
 6 |  * @param {{inject}} config
 7 |  * @param {DebuggerClient} debuggerClient
 8 |  * @param {InjectorClient} injectorClient
 9 |  * @param {FrontendClient} frontendClient
10 |  * @param {HeapProfilerClient} heapProfilerClient
11 | */
12 | function HeapProfilerAgent(config, session) {
13 |   try {
14 |     this._noInject = config.inject === false || config.inject.profiles === false;
15 |   } catch (e) {
16 |     this._noInject = false;
17 |   }
18 | 
19 |   this._injected = false;
20 |   this._debuggerClient = session.debuggerClient;
21 |   this._injectorClient = session.injectorClient;
22 |   this._frontendClient = session.frontendClient;
23 |   this._heapProfilerClient = session.heapProfilerClient;
24 | 
25 |   this._translateCommandToInjection(
26 |     'takeHeapSnapshot',
27 |     'getObjectByHeapObjectId',
28 |     'startTrackingHeapObjects',
29 |     'stopTrackingHeapObjects'
30 |   );
31 | 
32 |   if (!this._noInject) {
33 |     this._injectorClient.on('inject', this._inject.bind(this));
34 |   }
35 | }
36 | 
37 | HeapProfilerAgent.prototype._inject = function() {
38 |   this._translateEventToFrontend(
39 |     'reportHeapSnapshotProgress',
40 |     'addHeapSnapshotChunk',
41 |     'heapStatsUpdate',
42 |     'lastSeenObjectId'
43 |   );
44 | 
45 |   this._injectorClient.injection(
46 |     function(require, debug, options) {
47 |       require(options.injection)(require, debug, options);
48 |     },
49 |     {
50 |       injection: injection,
51 |       'v8-profiler': require.resolve('v8-profiler')
52 |     },
53 |     function(error, result) {
54 |       this._injected = !error;
55 | 
56 |       if (error) return this._frontendClient.sendLogToConsole('error', error.message || error);
57 |     }.bind(this)
58 |   );
59 | };
60 | 
61 | /**
62 |  * @param {...string} eventNames
63 | */
64 | HeapProfilerAgent.prototype._translateEventToFrontend = function(eventNames) {
65 |   Array.prototype.forEach.call(arguments, function(event) {
66 |     event = 'HeapProfiler.' + event;
67 |     this._debuggerClient.on(event, function(message) {
68 |       this._frontendClient.sendEvent(event, message);
69 |     }.bind(this));
70 |   }, this);
71 | };
72 | 
73 | /**
74 |  * @param {...string} commandNames
75 | */
76 | HeapProfilerAgent.prototype._translateCommandToInjection = function(commandNames) {
77 |   Array.prototype.forEach.call(arguments, function(command) {
78 |     this[command] = function(params, done) {
79 |       this._debuggerClient.request('HeapProfiler.' + command, params, function(error, result) {
80 |         if (command == 'getObjectByHeapObjectId' && result && result.result) {
81 |           this._heapProfilerClient.convertHandleToHeapHandle(result.result);
82 |           result.result = convert.v8ResultToInspectorResult(result.result);
83 |         }
84 |         done(error, result);
85 |       }.bind(this));
86 |     };
87 |   }, this);
88 | };
89 | 
90 | exports.HeapProfilerAgent = HeapProfilerAgent;
91 | 


--------------------------------------------------------------------------------
/lib/HeapProfilerClient.js:
--------------------------------------------------------------------------------
 1 | //heap:refHandle
 2 | var HEAP_ID_MATCHER = /^heap:(\d+)$/;
 3 | 
 4 | function HeapProfilerClient(config, session) {
 5 |   this._debuggerClient = session.debuggerClient;
 6 | }
 7 | 
 8 | HeapProfilerClient.prototype.isHeapObjectId = function(objectId) {
 9 |   return HEAP_ID_MATCHER.test(objectId);
10 | };
11 | 
12 | HeapProfilerClient.prototype.lookupHeapObjectId = function(objectId, done) {
13 |   var matchedId = HEAP_ID_MATCHER.exec(objectId);
14 |   this._debuggerClient.request(
15 |     'HeapProfiler._lookupHeapObjectId',
16 |     {
17 |       objectId: matchedId[1]
18 |     },
19 |     function(error, lookupBody, lookupRefs) {
20 |       if (error) return done(error);
21 | 
22 |       Object.keys(lookupRefs).forEach(function(key) {
23 |         this.convertHandleToHeapHandle(lookupRefs[key]);
24 |       }, this);
25 |       done(null, lookupBody, lookupRefs);
26 |     }.bind(this)
27 |   );
28 | };
29 | 
30 | HeapProfilerClient.prototype.convertHandleToHeapHandle = function(ref) {
31 |   if (ref.handle !== undefined) {
32 |     ref.handle = 'heap:' + ref.handle;
33 |   }
34 | };
35 | 
36 | exports.HeapProfilerClient = HeapProfilerClient;
37 | 


--------------------------------------------------------------------------------
/lib/Injections/ProfilerAgent.js:
--------------------------------------------------------------------------------
 1 | // This function will be injected into the target process.
 2 | module.exports = function(require, debug, options) {
 3 |   var path = require('path'),
 4 |       profiler = require(options['v8-profiler']);
 5 | 
 6 |   var profilingEnabled = false;
 7 | 
 8 |   debug.register('Profiler.start', function(request, response) {
 9 |     profiler.startProfiling();
10 |     profilingEnabled = true;
11 |   });
12 | 
13 |   debug.register('Profiler.stop', function(request, response) {
14 |     var profile = profiler.stopProfiling();
15 |     profilingEnabled = false;
16 |     response.body = {profile: profile};
17 |     process.nextTick(function() {
18 |       profile.delete();
19 |     });
20 |   });
21 | 
22 |   debug.on('close', function() {
23 |     if (profilingEnabled) profiler.stopProfiling();
24 | 
25 |     profiler.deleteAllProfiles();
26 |   });
27 | };


--------------------------------------------------------------------------------
/lib/InjectorServer.js:
--------------------------------------------------------------------------------
 1 | /**
 2 | * @param {Array} injections
 3 | * @param {Array} options
 4 | */
 5 | function injectorServer(options) {
 6 |   var nextHandleId = 0;
 7 | 
 8 |   var debug = require(options['v8-debug']);
 9 |   var makeMirrorSerializer = debug.get('MakeMirrorSerializer');
10 | 
11 |   global.process._require = require;
12 |   global.process._debugObject = debug;
13 | 
14 |   debug.convert = require(options['convert']);
15 | 
16 |   debug.serializeAndCacheMirror = function(cache, mirror, response) {
17 |     // Get previously cached mirror if existed
18 |     mirror = resolveCachedMirror(cache, mirror);
19 | 
20 |     var serializer = makeMirrorSerializer(true, {
21 |       maxStringLength: -1
22 |     });
23 |     var body = serializer.serializeValue(mirror);
24 | 
25 |     // Current serialization doesn't support internal properties refs
26 |     // Will be fixed after injecting InjectedScript.js
27 |     delete body.internalProperties;
28 | 
29 |     var refs = {};
30 |     serializer.mirrors_.forEach(function(refMirror) {
31 |       refs[refMirror.handle()] = resolveCachedMirror(cache, refMirror);
32 |     });
33 | 
34 |     Object.keys(body).forEach(function(key) {
35 |       var prop = body[key];
36 |       checkRefProperty(refs, prop);
37 |     });
38 | 
39 |     if (response) {
40 |       response.refs = serializer.mirrors_.map(function(refMirror) {
41 |         return debug.serializeAndCacheMirror(cache, refMirror);
42 |       });
43 |     }
44 | 
45 |     return body;
46 |   };
47 | 
48 |   function resolveCachedMirror(cache, mirror) {
49 |     var mirrorKey = Object.keys(cache).filter(function(key) {
50 |       var cached = cache[key];
51 | 
52 |       if (!mirror.value || !cached.value) return false;
53 | 
54 |       // Special check for NaN as NaN == NaN is false.
55 |       if (mirror.isNumber() && isNaN(mirror.value()) &&
56 |           cached.isNumber() && isNaN(cached.value())) {
57 |         return true;
58 |       }
59 | 
60 |       return mirror.value() === cached.value();
61 |     })[0];
62 | 
63 |     if (mirrorKey === undefined) {
64 |       mirrorKey = mirror.handle_ = nextHandleId++;
65 |       cache[mirrorKey] = mirror;
66 |     }
67 | 
68 |     return cache[mirrorKey];
69 |   }
70 | 
71 |   function checkRefProperty(refs, prop) {
72 |     if (typeof prop != 'object') return;
73 | 
74 |     if (prop.length)
75 |       prop.forEach(checkRefProperty.bind(null, refs));
76 |     else if (prop.ref !== undefined)
77 |       prop.ref = refs[prop.ref].handle();
78 |   }
79 | }
80 | 
81 | module.exports = injectorServer;
82 | 


--------------------------------------------------------------------------------
/lib/callback.js:
--------------------------------------------------------------------------------
 1 | 
 2 | /**
 3 |  * Create a callback container
 4 |  * @return {Object} that wraps callbacks and returns a one-time id.
 5 |  */
 6 | exports.create = function() {
 7 |   var lastId = 1,
 8 |       callbacks = {};
 9 | 
10 |   return Object.create({}, {
11 |     wrap: {
12 |       value: function(callback) {
13 |         var callbackId = lastId++;
14 |         callbacks[callbackId] = callback || function() {};
15 |         return callbackId;
16 |       }
17 |     },
18 |     processResponse: {
19 |       value: function(callbackId, args) {
20 |         var callback = callbacks[callbackId];
21 | 
22 |         if (callback) {
23 |           callback.apply(null, args);
24 |         }
25 | 
26 |         delete callbacks[callbackId];
27 |       }
28 |     },
29 |     removeResponseCallbackEntry: {
30 |       value: function(callbackId) {
31 |         delete callbacks[callbackId];
32 |       }
33 |     }
34 |   });
35 | };
36 | 


--------------------------------------------------------------------------------
/lib/session.js:
--------------------------------------------------------------------------------
 1 | var EventEmitter = require('events').EventEmitter,
 2 |     inherits = require('util').inherits,
 3 |     DebuggerClient = require('./DebuggerClient').DebuggerClient,
 4 |     ScriptManager = require('./ScriptManager').ScriptManager,
 5 |     FrontendClient = require('./FrontendClient').FrontendClient,
 6 |     FrontendCommandHandler = require('./FrontendCommandHandler').FrontendCommandHandler,
 7 |     BreakEventHandler = require('./BreakEventHandler').BreakEventHandler,
 8 |     ConsoleClient = require('./ConsoleClient').ConsoleClient,
 9 |     HeapProfilerClient = require('./HeapProfilerClient').HeapProfilerClient,
10 |     InjectorClient = require('./InjectorClient').InjectorClient;
11 | 
12 | function Session(config, debuggerHost, debuggerPort, wsConnection) {
13 |   this.debuggerClient = new DebuggerClient(debuggerHost, debuggerPort);
14 |   this.frontendClient = new FrontendClient(wsConnection);
15 |   this.injectorClient = new InjectorClient(config, this);
16 |   this.consoleClient = new ConsoleClient(config, this);
17 |   this.heapProfilerClient = new HeapProfilerClient(config, this);
18 |   this.scriptManager = new ScriptManager(config, this);
19 |   this.breakEventHandler = new BreakEventHandler(config, this);
20 |   this.frontendCommandHandler = new FrontendCommandHandler(config, this);
21 | 
22 |   this.resourceTreeResolved = false;
23 |   this.once('resource-tree-resolved', function() {
24 |     this.resourceTreeResolved = true;
25 |   }.bind(this));
26 | 
27 |   this.frontendClient.on('close', this.close.bind(this));
28 |   this.debuggerClient.on('close', this._onDebuggerClientClose.bind(this));
29 |   this.debuggerClient.on('error', this._onDebuggerClientError.bind(this));
30 | 
31 |   this._pingInterval = setInterval(function() {
32 |     wsConnection.ping(null, null, true);
33 |   }.bind(this), 1000);
34 | }
35 | 
36 | inherits(Session, EventEmitter);
37 | 
38 | Session.prototype.close = function() {
39 |   clearInterval(this._pingInterval);
40 |   if (this.debuggerClient.isConnected)
41 |     this.debuggerClient.close();
42 |   else
43 |     this.emit('close');
44 | };
45 | 
46 | Session.prototype._onDebuggerClientClose = function(reason) {
47 |   if (this.frontendClient.isConnected)
48 |     this.frontendClient.sendInspectorDetached(reason);
49 |   this.close();
50 | };
51 | 
52 | Session.prototype._onDebuggerClientError = function(e) {
53 |   var err = e.toString();
54 |   if (e.helpString) {
55 |     err += '\n' + e.helpString;
56 |   }
57 |   this.frontendClient.sendLogToConsole('error', err);
58 | };
59 | 
60 | module.exports = Session;
61 | 


--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
 1 | {
 2 |   "name": "node-inspector",
 3 |   "version": "1.1.2",
 4 |   "description": "Web Inspector based nodeJS debugger",
 5 |   "homepage": "http://github.com/node-inspector/node-inspector",
 6 |   "author": "Danny Coates <dannycoates@gmail.com>",
 7 |   "keywords": [
 8 |     "debug",
 9 |     "debugger",
10 |     "inspector",
11 |     "profiler"
12 |   ],
13 |   "repository": {
14 |     "type": "git",
15 |     "url": "http://github.com/node-inspector/node-inspector.git"
16 |   },
17 |   "engines": {
18 |     "node": ">=0.8.0"
19 |   },
20 |   "bin": {
21 |     "node-inspector": "./bin/inspector.js",
22 |     "node-debug": "./bin/node-debug.js"
23 |   },
24 |   "dependencies": {
25 |     "async": "~0.9",
26 |     "biased-opener": "~0.2.2",
27 |     "debug": "^2.2.0",
28 |     "express": "^4.12.3",
29 |     "glob": "^5.0.5",
30 |     "path-is-absolute": "^1.0.0",
31 |     "rc": "^1.0.1",
32 |     "semver": "^4.3.4",
33 |     "serve-favicon": "^2.1.1",
34 |     "strong-data-uri": "^1.0.0",
35 |     "v8-debug": "~1.0.0",
36 |     "v8-profiler": "~5.7.0",
37 |     "which": "^1.1.1",
38 |     "ws": "^1.0.1",
39 |     "yargs": "^3.9.0"
40 |   },
41 |   "devDependencies": {
42 |     "chai": "^3.5.0",
43 |     "fs-extra": "~0.8.1",
44 |     "install": "^0.8.7",
45 |     "jshint": "^2.4.4",
46 |     "mocha": "^1.21",
47 |     "npm": "^4.4.1",
48 |     "promise": "^7.0.3",
49 |     "rimraf": "^2.6.1"
50 |   },
51 |   "preferGlobal": true,
52 |   "scripts": {
53 |     "pretest": "jshint .",
54 |     "test": "mocha",
55 |     "generate-front-end": "node --harmony tools/generate-front-end"
56 |   }
57 | }
58 | 


--------------------------------------------------------------------------------
/test/FrontendCommandHandler.test.js:
--------------------------------------------------------------------------------
 1 | var async = require('async');
 2 | var expect = require('chai').expect;
 3 | var launcher = require('./helpers/launcher.js');
 4 | var FrontendCommandHandler = require('../lib/FrontendCommandHandler.js').FrontendCommandHandler;
 5 | var FrontendClient = require('../lib/FrontendClient.js').FrontendClient;
 6 | var ScriptFileStorage = require('../lib/ScriptFileStorage.js').ScriptFileStorage;
 7 | var ScriptManager = require('../lib/ScriptManager.js').ScriptManager;
 8 | var InjectorClient = require('../lib/InjectorClient.js').InjectorClient;
 9 | var WebSocketMock = require('./helpers/wsmock');
10 | 
11 | describe('FrontendCommandHandler', function() {
12 |   before(setupProcess);
13 | 
14 |   var session;
15 | 
16 |   function setupProcess(done) {
17 |     launcher.startDebugger(
18 |       'BreakInFunction.js',
19 |       function(childProcess, _session) {
20 |         session = _session;
21 |         done();
22 |       });
23 |   }
24 | 
25 |   it('defers "scriptParsed" events until "Page.getResourceTree"', function(done) {
26 |     this.timeout(5000);
27 | 
28 |     var TREE_REQID = 10;
29 | 
30 |     async.waterfall([
31 |       function arrange(cb) {
32 |         this.wsmock = new WebSocketMock();
33 | 
34 |         var handler = createFrontendCommandHandler(this.wsmock, session);
35 |         this.handler = handler;
36 |         this.handleCommand = function(req) {
37 |           handler.handleCommand(req);
38 |         };
39 | 
40 |         cb();
41 |       },
42 | 
43 |       function act(cb) {
44 |         this.handleCommand({ id: 1, method: 'Debugger.enable' });
45 | 
46 |         // Introduce a small timeout to let DebuggerAgent fetch scripts
47 |         setTimeout(function() {
48 |           this.handleCommand({ id: TREE_REQID, method: 'Page.getResourceTree' });
49 |         }.bind(this), 100);
50 | 
51 |         this.wsmock.on('send', function(payload) {
52 |           if (payload.id == TREE_REQID)
53 |             cb();
54 |         });
55 |       },
56 | 
57 |       function verify(cb) {
58 |         var events = [];
59 |         this.wsmock.messages.forEach(function(msg) {
60 |           if (msg.id == TREE_REQID) {
61 |             events.push('resources');
62 |           } else if (msg.method == 'Debugger.scriptParsed') {
63 |             if (events.indexOf('scripts') == -1)
64 |               events.push('scripts');
65 |           }
66 |         });
67 | 
68 |         expect(events).to.eql(['resources', 'scripts']);
69 |         cb();
70 |       }
71 |     ], done);
72 |   });
73 | 
74 |   function createFrontendCommandHandler(wsclient, session) {
75 |     var config = {inject: false};
76 |     session.frontendClient = new FrontendClient(wsclient);
77 |     session.injectorClient = new InjectorClient(config, session);
78 |     session.scriptManager = new ScriptManager(config, session);
79 |     session.breakEventHandler = {};
80 | 
81 |     return new FrontendCommandHandler(config, session);
82 |   }
83 | });
84 | 


--------------------------------------------------------------------------------
/test/PageAgent.js:
--------------------------------------------------------------------------------
 1 | var expect = require('chai').expect,
 2 |   launcher = require('./helpers/launcher.js'),
 3 |   ScriptManager = require('../lib/ScriptManager.js').ScriptManager,
 4 |   PageAgent = require('../lib/PageAgent.js').PageAgent;
 5 | 
 6 | describe('PageAgent', function() {
 7 |   describe('getResourceContent()', function() {
 8 |     before(setupDebugScenario);
 9 | 
10 |     it('does not throw an error', function(done) {
11 |       expect(function() { agent.getResourceContent({
12 |         url: 'index.js'
13 |       }, done); }).to.not.throw();
14 |     });
15 | 
16 |     var agent;
17 | 
18 |     function setupDebugScenario(done) {
19 |       launcher.runOnBreakInFunction(function(session) {
20 |         session.scriptManager = new ScriptManager({}, session);
21 | 
22 |         agent = new PageAgent({}, session);
23 |         done();
24 |       });
25 |     }
26 |   });
27 | });
28 | 


--------------------------------------------------------------------------------
/test/ProfilerAgent.js:
--------------------------------------------------------------------------------
 1 | var expect = require('chai').expect,
 2 |     launcher = require('./helpers/launcher.js'),
 3 |     EventEmitter = require('events').EventEmitter,
 4 |     InjectorClient = require('../lib/InjectorClient').InjectorClient,
 5 |     ProfilerAgent = require('../lib/ProfilerAgent').ProfilerAgent;
 6 | 
 7 | var profilerAgent,
 8 |     debuggerClient,
 9 |     frontendClient;
10 | 
11 | describe('Profiler Agent', function() {
12 |   before(initializeProfiler);
13 | 
14 |   it('should start profiling', function(done) {
15 |     profilerAgent.start({}, function(error, result){
16 |       if (error) return done(error);
17 |       expect(result).to.equal(undefined);
18 |       done();
19 |     });
20 |   });
21 | 
22 |   it('should stop profiling', function(done) {
23 |     profilerAgent.stop({}, function(error, result) {
24 |       if (error) return done(error);
25 |       expect(result).to.have.property('profile');
26 |       done();
27 |     });
28 |   });
29 | 
30 |   describe('nodeVersionIsCompatible', function() {
31 |     it('returns false for v0.10.29', function(done) {
32 |       expect(ProfilerAgent.nodeVersionIsCompatible('v0.10.29'))
33 |         .to.equal(false);
34 |       done();
35 |     });
36 | 
37 |     it('returns false for v0.11.12', function(done) {
38 |       expect(ProfilerAgent.nodeVersionIsCompatible('v0.11.12'))
39 |         .to.equal(false);
40 |       done();
41 |     });
42 | 
43 |     it('returns true for v0.11.13', function(done) {
44 |       expect(ProfilerAgent.nodeVersionIsCompatible('v0.11.13'))
45 |         .to.equal(true);
46 |       done();
47 |     });
48 | 
49 |     it('returns true for v0.12.0', function(done) {
50 |       expect(ProfilerAgent.nodeVersionIsCompatible('v0.12.0'))
51 |         .to.equal(true);
52 |       done();
53 |     });
54 | 
55 |     it('returns true for v1.0.0', function(done) {
56 |       expect(ProfilerAgent.nodeVersionIsCompatible('v1.0.0'))
57 |         .to.equal(true);
58 |       done();
59 |     });
60 |   });
61 | });
62 | 
63 | function initializeProfiler(done) {
64 |   launcher.runCommandlet(false, function(childProcess, session) {
65 |     debuggerClient = session.debuggerClient;
66 |     frontendClient = session.frontendClient;
67 | 
68 |     var injectorClient = new InjectorClient({}, session);
69 |     session.injectorClient = injectorClient;
70 | 
71 |     profilerAgent = new ProfilerAgent({}, session);
72 | 
73 |     injectorClient.inject(function(error) {
74 |       done(error);
75 |     });
76 |   });
77 | }
78 | 


--------------------------------------------------------------------------------
/test/fixtures/BreakInFunction.js:
--------------------------------------------------------------------------------
 1 | /*jshint debug:true */
 2 | function MyObj() {
 3 | }
 4 | 
 5 | MyObj.prototype = {
 6 |   myFunc: function(msg, meta) {
 7 |     console.log(msg, meta);
 8 |     this.called = true;
 9 |     debugger;
10 |   }
11 | };
12 | 
13 | function globalFunc(msg, meta) {
14 |   obj.myFunc(msg, meta);
15 | }
16 | 
17 | var obj = new MyObj();
18 | 
19 | process.stdin.once('data', function() {
20 |   globalFunc('hello', { world: 'true' });
21 |   console.log(obj.called);
22 | });
23 | 


--------------------------------------------------------------------------------
/test/fixtures/InspectObject.js:
--------------------------------------------------------------------------------
 1 | /*jshint debug:true */
 2 | function InspectedClass() {
 3 |   this.writableProp = 'wr';
 4 |   Object.defineProperty(this, 'readonlyProp', { value: 'ro' });
 5 | }
 6 | 
 7 | process.stdin.once('data', function() {
 8 |   function localFunc() { return 'local'; }
 9 | 
10 |   var inspectedObject = new InspectedClass();
11 | 
12 |   debugger;
13 |   console.log(inspectedObject.writableProp, localFunc());
14 | });
15 | 


--------------------------------------------------------------------------------
/test/fixtures/LiveEdit.js:
--------------------------------------------------------------------------------
1 | /*jshint debug:true */
2 | process.stdin.once('data', function() {
3 |   debugger;
4 | });
5 | 


--------------------------------------------------------------------------------
/test/fixtures/PeriodicConsoleLog.js:
--------------------------------------------------------------------------------
1 | var a = 0;
2 | console.log(a);
3 | setInterval(function(){
4 |   console.log(++a);
5 | }, 1000);
6 | 


--------------------------------------------------------------------------------
/test/fixtures/ssl_cert_and_key.txt:
--------------------------------------------------------------------------------
1 | ------ Begin Fake Key and Cert ------
2 | 8888D52FAC978888E64DF4D288887713C2798888283E491F
3 | 8888EA4EA931888883C318748888A893F82B8888D74A677A
4 | ------ End Fake Key and Cert ------
5 | 


--------------------------------------------------------------------------------
/test/helpers/SessionStub.js:
--------------------------------------------------------------------------------
 1 | var EventEmitter = require('events').EventEmitter,
 2 |     inherits = require('util').inherits;
 3 | 
 4 | module.exports = SessionStub;
 5 | 
 6 | function SessionStub() {
 7 |   this.debuggerClient = new DebuggerClientStub();
 8 |   this.frontendClient = new FrontendClientStub();
 9 | 
10 |   this.resourceTreeResolved = true;
11 | }
12 | inherits(SessionStub, EventEmitter);
13 | 
14 | function DebuggerClientStub() {}
15 | inherits(DebuggerClientStub, EventEmitter);
16 | 
17 | DebuggerClientStub.prototype.close = function() {
18 |   this.emit('close');
19 | };
20 | 
21 | function FrontendClientStub() {}
22 | inherits(FrontendClientStub, EventEmitter);
23 | 
24 | FrontendClientStub.prototype.sendEvent = function(event, message) {
25 |   this.emit(event, message);
26 | };
27 | FrontendClientStub.prototype.sendLogToConsole = function(type, message) {
28 |   throw new Error(message);
29 | };
30 | FrontendClientStub.prototype.off = function() {
31 |   this.removeListener.apply(this, arguments);
32 | };
33 | 


--------------------------------------------------------------------------------
/test/helpers/wsmock.js:
--------------------------------------------------------------------------------
 1 | var inherits = require('util').inherits;
 2 | var EventEmitter = require('events').EventEmitter;
 3 | 
 4 | module.exports = WebSocketMock;
 5 | 
 6 | function WebSocketMock() {
 7 |   this.messages = [];
 8 | }
 9 | 
10 | inherits(WebSocketMock, EventEmitter);
11 | 
12 | WebSocketMock.prototype.send = function(payload) {
13 |   try {
14 |     payload = JSON.parse(payload);
15 |   } catch (e) {
16 |     // no-op, use the original string
17 |   }
18 | 
19 |   this.messages.push(payload);
20 |   this.emit('send', payload);
21 | };
22 | 


--------------------------------------------------------------------------------
/test/index.js:
--------------------------------------------------------------------------------
 1 | var util = require('util'),
 2 |     expect = require('chai').expect;
 3 | 
 4 | var index = require('../index');
 5 | 
 6 | describe('index', function() {
 7 |   describe('buildInspectorUrl', function() {
 8 |     it('should build an http URL', function() {
 9 |       var url = index.buildInspectorUrl(
10 |         'example.com',
11 |         '2223',
12 |         '7863',
13 |         false
14 |       );
15 |       expect(url).to.equal('http://example.com:2223/?port=7863');
16 |     });
17 | 
18 |     it('should build an http URL', function() {
19 |       var url = index.buildInspectorUrl(
20 |         'example.com',
21 |         '2223',
22 |         '7863',
23 |         true
24 |       );
25 |       expect(url).to.equal('https://example.com:2223/?port=7863');
26 |     });
27 |   });
28 | 
29 |   describe('buildWebSocketUrl', function() {
30 |     it('should build an ws URL', function() {
31 |       var url = index.buildWebSocketUrl(
32 |         'example.com',
33 |         '2223',
34 |         '7863',
35 |         false
36 |       );
37 |       expect(url).to.equal('ws://example.com:2223/?port=7863');
38 |     });
39 | 
40 |     it('should build an wss URL', function() {
41 |       var url = index.buildWebSocketUrl(
42 |         'example.com',
43 |         '2223',
44 |         '7863',
45 |         true
46 |       );
47 |       expect(url).to.equal('wss://example.com:2223/?port=7863');
48 |     });
49 |   });
50 | 
51 | });
52 | 


--------------------------------------------------------------------------------
/test/mocha.opts:
--------------------------------------------------------------------------------
1 | --require chai


--------------------------------------------------------------------------------
/tools/git-changelog.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/bash
 2 | 
 3 | FILE=""
 4 | NULL="/dev/null"
 5 | LIST=false
 6 | TAG=$(node -e "console.log(require('./package.json').version)")
 7 | tmp="$TMPDIR/changelog"
 8 | name=`echo $(uname -s) | cut -c 1-10`;
 9 | 
10 | if [ $name == "MINGW32_NT" ]; then
11 |   NULL="NUL";
12 |   tmp="._changelog"
13 | fi
14 | 
15 | while [ "$1" != "" ]; do
16 |   case $1 in
17 |     -l | --list )
18 |       LIST=true
19 |       ;;
20 |     -t | --tag )
21 |       TAG=$2
22 |       shift
23 |       ;;
24 |     * )
25 |       FILE=$1
26 |       ;;
27 |   esac
28 |   shift
29 | done
30 | 
31 | DATE=`date +'%Y-%m-%d'`
32 | HEAD="## $DATE, Version $TAG\n\n"
33 | 
34 | if $LIST; then
35 |   printf "$HEAD"
36 |   lasttag=$(git rev-list --tags --max-count=1 2>$NULL)
37 |   version=$(git describe --tags --abbrev=0 $lasttag 2>$NULL)
38 |   export GIT_PAGER=cat # disable pager when running interactively
39 |   if test -z "$version"; then
40 |     git log --no-merges --pretty="format: * %s (%an)%n"
41 |   else
42 |     git log --no-merges --pretty="format: * %s (%an)%n" $version..
43 |   fi
44 |   exit
45 | fi
46 | 
47 | CHANGELOG=$FILE
48 | if test "$CHANGELOG" = ""; then
49 |   CHANGELOG=`ls | egrep 'change|history' -i|head -n1`
50 |   if test "$CHANGELOG" = ""; then
51 |     CHANGELOG='History.md';
52 |   fi
53 | fi
54 | 
55 | $0 --list >> $tmp
56 | printf '\n' >> $tmp
57 | if [ -f $CHANGELOG ]; then echo "" >> $tmp; cat $CHANGELOG >> $tmp; fi
58 | mv $tmp $CHANGELOG
59 | test -n "$EDITOR" && $EDITOR $CHANGELOG
60 | 


--------------------------------------------------------------------------------
/tools/release.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/bash
 2 | 
 3 | set -e
 4 | 
 5 | VERSION=${1:?version is mandatory}
 6 | TAG=v${VERSION}
 7 | 
 8 | PREPUBLISH=true
 9 | VERIFY=true
10 | while [ "$1" != "" ]; do
11 |   case $1 in
12 |     -f | --forse | --no-verify )
13 |       VERIFY=false
14 |       ;;
15 |     -p | --publish )
16 |       PREPUBLISH=false
17 |       ;;
18 |   esac
19 |   shift
20 | done
21 | 
22 | echo --RELEASE $VERSION AS TAG $TAG--
23 | 
24 | 
25 | if $PREPUBLISH; then
26 | 
27 |   if $VERIFY; then
28 |     echo --Pull remote changes--
29 |     git pull
30 | 
31 |     echo --Reinstall all dependencies--
32 |     rm -rf node_modules && npm install
33 | 
34 |     echo --Run the tests--
35 |     npm test
36 |   fi
37 | 
38 | 
39 |   echo --Update the version in package.json--
40 |   npm version --git-tag-version=false "$VERSION"
41 | 
42 |   echo --Update ChangeLog.md--
43 |   tools/git-changelog.sh -t "$VERSION"
44 | 
45 |   echo --Commit the changes--
46 |   git commit -m "$VERSION" ChangeLog.md package.json
47 | 
48 |   echo --Tag the release--
49 |   tools/git-changelog.sh -l -t "$VERSION" | git tag -a "$TAG" -F-
50 | fi
51 | 
52 | echo --Push to github--
53 | git push && git push origin "$TAG"
54 | 
55 | echo --Publish to npmjs.org--
56 | npm publish
57 | 
58 | echo --RELEASED $VERSION--
59 | 


--------------------------------------------------------------------------------
/tools/update-front-end.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | REPOURL="http://src.chromium.org/blink/branches/chromium"
 4 | 
 5 | BRANCH=$1
 6 | 
 7 | if [ -z "$BRANCH" ]; then
 8 |   echo "Missing branch id"
 9 |   echo "Usage:"
10 |   echo "  $0 <branchId>"
11 |   echo "Check the following URL to see the list of all branches:"
12 |   echo "  $REPOURL"
13 |   exit 1
14 | fi
15 | 
16 | BRANCHURL="$REPOURL/$BRANCH"
17 | 
18 | rm -rf blink-devtools
19 | mkdir blink-devtools
20 | 
21 | echo "Checking out front-end files"
22 | svn checkout "$BRANCHURL/Source/devtools" blink-devtools
23 | 
24 | echo "Updating front-end"
25 | rm -rf front-end/*
26 | cp -r blink-devtools/front_end/* front-end
27 | find front-end -name '.svn' -type d -exec rm -rf {} \; > /dev/null
28 | cp blink-devtools/protocol.json tools
29 | 
30 | echo "Done."
31 | rm -rf blink-devtools
32 | 


--------------------------------------------------------------------------------