nada
interface MyInterface {
prop1: string;
prop2: number;
// other properties
}
const myObject: MyInterface = {
prop1: "value1",
prop2: 123,
name | wikipedia_url | |
---|---|---|
A# .NET | https://en.wikipedia.org/wiki/A_Sharp_(.NET) | |
A# (Axiom) | https://en.wikipedia.org/wiki/A_Sharp_(Axiom) | |
A-0 System | https://en.wikipedia.org/wiki/A-0_System | |
A+ | https://en.wikipedia.org/wiki/A%2B_(programming_language) | |
A++ | https://en.wikipedia.org/wiki/A%2B%2B | |
ABAP | https://en.wikipedia.org/wiki/ABAP | |
ABC | https://en.wikipedia.org/wiki/ABC_(programming_language) | |
ABC ALGOL | https://en.wikipedia.org/wiki/ABC_ALGOL | |
ABSET | https://en.wikipedia.org/wiki/ABSET |
%%{
init: {
'theme': 'base',
'themeVariables': {
'primaryColor': '#BB2528',
'primaryTextColor': '#fff',
'primaryBorderColor': '#7C0000',
'lineColor': '#F8B229',
'secondaryColor': '#000',
Using createTextNode
to set the content of a <style>
element is generally considered a safer practice compared to using innerHTML
. Using createTextNode
ensures that the content is treated as pure text and not parsed as HTML. This can prevent potential cross-site scripting (XSS) attacks if the CSS content were to somehow include malicious code.
Also, using the createTextNode
approach is a more standards-compliant way to insert text content into the DOM. It ensures that the content is treated exactly as text, without any ambiguity. While the performance difference is usually negligible, createTextNode
can sometimes be more efficient as it doesn't involve the HTML parser.
But in tightly controlled cases, innerHTML
is fine. Here's an example of injection from a URL:
function injectCSS(url: string, id: string) {
An error encountered while trying to instantiate a class from the node package I'm builiding, blockly_multiselect_plugin
.
Bundling a node project for distribution as a library should be the same as bundling an application. One exception is that you need to expose exports from the package's entry point using Webpack's output.library
option.
When targeting a library, especially when libraryTarget
is 'umd'
, the globalObject
option indicates what global object will be used to mount the library. To make UMD build available on both browsers and Node.js, set output.globalObject
option to 'this'
. The globalObject option defaults to 'self'
for Web-like targets.
The following fragment of webpack.config.js shows how to correctly export the entry point for consumption by other packages.
import Blockly from 'blockly'; | |
declare interface CustomNode extends Node { | |
removeAttribute(arg0: string); | |
} | |
const DOMURL = window.URL || window.webkitURL; | |
const getSvgBlob = (workspace: Blockly.WorkspaceSvg) => { | |
const canvas = workspace.svgBlockCanvas_.cloneNode(true) as CustomNode; |
On Mac, launch browser using a dedicated profile. This will create directory remote-profile
in cwd.
% /Applications/GoogleChrome.app/Contents/MacOS/GoogleChrome --remote-debugging-port=9222 --user-data-dir=remote-profile
DevTools listening on ws://127.0.0.1:9222/devtools/browser/1f9619a3-abe2-449b-a81e-dde827123e20
Make sure that webroot
points to the webpack-built distribution of your extension that's loaded by the browser.