link element not append in head element in ediot.canvas #firefox #grapesjs
Question
am trying to add google fonts in web-builder to change the font style for that to import am adding cdn in editor the code works in chrome and safari but firefox not working
createLinkElement(fontFamily) {
let link = document.createElement("LINK");
link.setAttribute("rel", "stylesheet");
link.setAttribute("href", `https://fonts.googleapis.com/css?family=${fontFamily}`);
return link;
}
editor.Canvas.getDocument().head.append(this.createLinkElement(fontFamily));
element also not appendingAnswers (3)
I've made the issue template for a reason
I've made the issue template for a reason
i want to add custom fonts in web builder could you please help me out
Hi! might be very late to comment but have you tried this? -
const link1 = document.createElement('link');
link1.rel = 'stylesheet';
link1.href = '/page-builder-assets/css/style.css';
canvas.getDocument().head.appendChild(link1);
it worked for meRelated Questions and Answers
Continue research with similar issue discussions.
Issue #950
Editor.setdevice() not working properly on some browsers.
I am changing the device by using editor.setdevice function by calling it in document.ready function. On most devices it is working fine bu...
Issue #5631
BUG: Undo manager add() not working as expected
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v91 Reproducible demo link -- Descr...
Issue #4501
BUG:
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link no demo link...
Issue #3644
BUG: link showing as span when getHtml() called
Hi , @artf I using CKEDITOR for add link into selected text it is working fine . i am using this code to add link it is showing as the abov...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.