Skip to content

Commit

Permalink
Merge pull request #16 from bung87/fix11
Browse files Browse the repository at this point in the history
fix #11
  • Loading branch information
juancarlospaco authored Aug 8, 2022
2 parents 81b7737 + 0f4c098 commit bcd5862
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/webgui.nim
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const
if (typeof $2 === 'undefined') {
$2 = {};
}
$2.$1 = (arg) => {
$2.$1 = function (arg) {
window.external.invoke(
JSON.stringify(
{scope: "$2", name: "$1", args: JSON.stringify(arg)}
Expand All @@ -123,7 +123,7 @@ const
if (typeof $2 === 'undefined') {
$2 = {};
}
$2.$1 = (arg) => {
$2.$1 = function (arg) {
window.external.invoke(
JSON.stringify(
{scope: "$2", name: "$1", args: JSON.stringify(arg)}
Expand All @@ -135,7 +135,7 @@ const
if (typeof $2 === 'undefined') {
$2 = {};
}
$2.$1 = () => {
$2.$1 = function () {
window.external.invoke(
JSON.stringify(
{scope: "$2", name: "$1", args: ""}
Expand Down
4 changes: 2 additions & 2 deletions src/webview.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ struct webview_dispatch_arg {
"3C%2Fbody%3E%0A%3C%2Fhtml%3E"

#define CSS_INJECT_FUNCTION \
"(function(e){var " \
"(function(e){window.onload = function(){var " \
"t=document.createElement('style'),d=document.head||document." \
"getElementsByTagName('head')[0];t.setAttribute('type','text/" \
"css'),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document." \
"createTextNode(e)),d.appendChild(t)})"
"createTextNode(e)),d.appendChild(t)}})"

static const char *webview_check_url(const char *url) {
if (url == NULL || strlen(url) == 0) {
Expand Down

0 comments on commit bcd5862

Please sign in to comment.