All Projects → weirongxu → coc-webview

weirongxu / coc-webview

Licence: MIT license
Using an external browser to support the webview in coc.nvim.

Programming Languages

typescript
32286 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to coc-webview

coc-sql
SQL extension for coc.nvim
Stars: ✭ 104 (+395.24%)
Mutual labels:  coc, coc-nvim
coc-nginx
nginx-language-server extension for coc.nvim
Stars: ✭ 16 (-23.81%)
Mutual labels:  coc, coc-nvim
coc-volar
Volar (Fast Vue Language Support) extension for coc.nvim
Stars: ✭ 143 (+580.95%)
Mutual labels:  coc, coc-nvim
coc-toml
Toml extension for coc-nvim, using taplo for lsp engine
Stars: ✭ 52 (+147.62%)
Mutual labels:  coc, coc-nvim
Vanadium
Privacy and security enhanced releases of Chromium for GrapheneOS. Vanadium provides the WebView and standard user-facing browser on GrapheneOS. It depends on hardening in other GrapheneOS repositories and doesn't include patches not relevant to the build targets used on GrapheneOS.
Stars: ✭ 365 (+1638.1%)
Mutual labels:  webview
coc-rime
Rime input method source for coc.nvim
Stars: ✭ 22 (+4.76%)
Mutual labels:  coc
Hybrid-Web-Platform
Full-fledged WebView as Xamarin.Forms plugin with cross-platform C# to JavaScript and JavaScript to C# calls support. Eventually invented for painless hybrid apps creation.
Stars: ✭ 19 (-9.52%)
Mutual labels:  webview
pycon-code-of-conduct
PyCon Korea's code of conduct
Stars: ✭ 24 (+14.29%)
Mutual labels:  coc
code-of-conduct
The rule of St. Benedict as your Code of Conduct
Stars: ✭ 21 (+0%)
Mutual labels:  coc
vscode-http-client
Simple way to do HTTP requests in Visual Studio Code.
Stars: ✭ 26 (+23.81%)
Mutual labels:  webview
Bloop
A light weight scratch pad inspired and derived from https://github.com/IvanMathy/Boop.
Stars: ✭ 54 (+157.14%)
Mutual labels:  webview
WebViewExample
work as a webview testing environment for frontend developers
Stars: ✭ 19 (-9.52%)
Mutual labels:  webview
UIFramework
A powerful UI framework for the game Onset (https://playonset.com/)
Stars: ✭ 13 (-38.1%)
Mutual labels:  webview
btt
Low level MacOS management in JavaScript via BetterTouchTool
Stars: ✭ 92 (+338.1%)
Mutual labels:  webview
nativescript-webview-interface
Plugin for bi-directional communication between webView and android/ios
Stars: ✭ 87 (+314.29%)
Mutual labels:  webview
TrendingCustomAlert
You can use a ready-made custom alert controller.
Stars: ✭ 25 (+19.05%)
Mutual labels:  webview
FlexHybridApp-Android
WebView bridge interface with Promise pattern
Stars: ✭ 20 (-4.76%)
Mutual labels:  webview
MHWebViewController
An Instagram inspired Web View Controller.
Stars: ✭ 75 (+257.14%)
Mutual labels:  webview
pdfjs
A sample for showing PDF files in a Xamarin.Forms application with pdf.js
Stars: ✭ 32 (+52.38%)
Mutual labels:  webview
electric-webview
Electric WebView is a scriptable WebView for developers.
Stars: ✭ 16 (-23.81%)
Mutual labels:  webview

coc-webview

Webview panel ported to coc.nvim

Install

:CocInstall coc-webview

Lists

:CocList webview

Webview as API

Install the coc-webview to devDependencies

// import only type
import type { WebviewAPI, WebviewPanel } from 'coc-webview';

// fetch API
let webviewExt: Extension<WebviewAPI> | undefined;

const getWebviewAPI = () => {
  if (!webviewExt) {
    webviewExt = extensions.all.find((ext) => ext.id === 'coc-webview') as Extension<WebviewAPI> | undefined;
  }
  if (!webviewExt) {
    const hint = 'Please install the coc-webview extension';
    void window.showErrorMessage(hint);
    throw new Error(hint);
  }
  return webviewExt.exports;
};

// create webview panel
export async function example(): Promise<void> {
  const panel = await getWebviewAPI().createWebviewPanel(
    // viewType
    'markdown-preview-enhanced',
    // title
    `Preview markdown`,
    {
      // open in browser
      openURL: true,
      // route name
      routeName: 'markdown-preview-enhanced',
    },
    {
      localResourceRoots: [...],
      enableScripts: true,
    }
  );

  // update title
  panel.title = 'Preview markdown-2'

  // update html
  panel.webview.html = '<html>...</html>'

  // postMessage
  panel.webview.postMessage({type: 'command', 'token': 'xxx'})

  this.onDidReceiveMessage((msg: {type: string, token: string}) => {
    // msg.type
  });

  cosnt util = getWebviewAPI().util;
  util.openUri('https://domain.com/');
}

Configurations

Usage: https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file

  • webview.debug: Enable debug mode
  • webview.colorStrategy: Color strategy for webview
  • webview.primaryColors: Primary colors for webview
  • webview.minPort: Mix port for webview service
  • webview.maxPort: Max port for webview service
  • webview.openCommand: Command template for open webview, arguments(%u webview url), example: chrome "%u"

TODO

  • dark mode
  • webview reveal
  • display iconPath
  • vim keybinding
  • cspSource

License

MIT


This extension is built with create-coc-extension

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].