Comments (6)
Update: it looks like commenting out this line of code prevents it the console output from showing
which is also equivalent to setting debug to false.
if (w->debug) {
WebKitSettings *settings =
webkit_web_view_get_settings(WEBKIT_WEB_VIEW(w->priv.webview));
//webkit_settings_set_enable_write_console_messages_to_stdout(settings, true);
webkit_settings_set_enable_developer_extras(settings, true);
}
I need to look for the granular settings like the console messages format to not include the source url.
This is a deep rabbit hole and i thought it is.
from web-view.
I think the only thing you can do is monkey patch console.log to do nothing, although I think disabling debug mode (parameter passed to run) also disables console.log output.
from web-view.
Is the code in the rust code, or in the webkit-gtk which is a standard debian package. I'm not sure if will work, editing the include files of libwebkit-gtk-dev.
from web-view.
I think you can just set debug
to false
or do console.log = function() {};
See also my issue here: webview/webview#75
The best way seems to be to use RPC and log from the Rust code..
from web-view.
So, I'm having trouble because intercepting console.error
isn't working. My current solution has been:
console.log = console.info = console.error = (str) => {
const consoleElem = document.getElementById('console');
const out = typeof str === "string" ? str : JSON.stringify(str)
consoleElem.appendChild(document.createElement('li')).textContent = out;
if (consoleElem.childNodes.length > 1000) {
consoleElem.firstChild.remove();
}
consoleElem.scrollTop = consoleElem.scrollHeight;
}
It works perfectly for normal logging, giving console output in the window itself. The result for errors is the usual impossibly large tty spam on the command line. The whole index.html is prepended as a data url.
from web-view.
Whenever console.log is called in my javascript, the whole html document is printed before the console.log output.
I'm getting the same problem, I want to inline a bunch of code, and it's printing the entire document, which is just silly. But disabling debug mode means I lose access to the developer tools. There needs to be a way to control this.
from web-view.
Related Issues (20)
- Way to get current URL?
- Debug mode dumps HTML on every console message HOT 1
- Is there a ready event?
- Is this browser ready?
- Is there a way to access the true file system path when using a "Browse" button on webview?
- [Solved] Compilation fails with Edge feature enabled HOT 1
- Hovering over an image for alt text causes `NSException` on macOS 12.1 w/ M1
- Is multitouch supported? HOT 1
- Android? iOS?
- Make a fork and cooperate to maintain this crate! HOT 1
- box-shadow wrongly displayed
- iframe support?
- Corrupted files
- Is there a way to open two webview windows without crashing? HOT 1
- external.invoke returns undefined instead of promise on Windows 10 HOT 1
- Rust Webview JavaScript interface
- how to create handler? HOT 1
- Impossible to embed a local .js file to the .html code - it is simply not loaded HOT 1
- Blank page when running on X11 (but Wayland is ok)
- macos webview_cocoa.c unknown error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-view.