question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Certain API methods are not available

See original GitHub issue

When I try to use the CSS.toggleProperty method defined in the Chrome Debugger Protocol Viewer docs, I get an error:

>>> CSS.toggleProperty({ 'styleId': { 'styleSheetId': '56219.1', 'ordinal': 1 }, 'propertyIndex': 1, 'disable': true })
TypeError: CSS.toggleProperty is not a function
    at repl:1:5
    at REPLServer.defaultEval (repl.js:250:27)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:412:12)
    at emitOne (events.js:82:20)
    at REPLServer.emit (events.js:169:7)
    at REPLServer.Interface._onLine (readline.js:210:10)
    at REPLServer.Interface._line (readline.js:549:8)
    at REPLServer.Interface._ttyWrite (readline.js:826:14)

The same happens for DOM.setInspectModeEnabled.

>>> DOM.setInspectModeEnabled({ 'enabled': true })
TypeError: DOM.setInspectModeEnabled is not a function
    at repl:1:5
    at REPLServer.defaultEval (repl.js:250:27)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:412:12)
    at emitOne (events.js:82:20)
    at REPLServer.emit (events.js:169:7)
    at REPLServer.Interface._onLine (readline.js:210:10)
    at REPLServer.Interface._line (readline.js:549:8)
    at REPLServer.Interface._ttyWrite (readline.js:826:14)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
aslushnikovcommented, Oct 4, 2016

@sarahlim which range are you sending? The style range should start right after the rule’s { and end before rule’s ending }.

here’s the inspector-protocol test which exercises this method: link

1reaction
cyrus-andcommented, Oct 4, 2016

@sarahlim since I’m reading this anyway, here’s my two cents…

The fact is that figuring out the proper source range can be tricky and AFAIK there is no protocol method that aids you in figuring out the range given a CSS rule selector; you need to first walk the matched CSS rules for a given a NodeId with CSS.getMatchedStylesForNode. Which seems to be what DevTools does when you toggle the checkbox of a CSS rule (if you inspect its WebSocket).

I don’t know about your use case, but another approach would be: fetch the whole style sheet text with CSS.getStyleSheetText, perform the desired modifications and replace the original one with CSS.setStyleSheetText.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Method not found in Web API 2 - Stack Overflow
I have gone through some tutorials and now Im trying to set up my web service. I have a really hard time trying...
Read more >
Post Method is not called Web APi - MSDN - Microsoft
I am new in Web API. I had put some code in API controller for GET and POST. in case of GET, it...
Read more >
ASP.NET Core Web API - How to Handle GET Request
Learn how to handle Get Request in .NET Core by using previously created repository pattern for business logic and how to write great ......
Read more >
Building an ASP.NET Web API with ASP.NET Core - Toptal
In this article, I'll show you how to make an API for a small cost management system, including basic settings for authentication and...
Read more >
Reference-Tableau Server REST API
This method is not available for Tableau Server. ... Download Data Source Revision, Downloads a specific version of a data source prior to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found