Jump to content

vmars316

Members
  • Content Count

    421
  • Joined

  • Last visited

Everything posted by vmars316

  1. Hello; I found exactly what I need here: https://gist.github.com/erickzhao/3f2141be4c6d84c3028742b8998e0f6e
  2. Thanks niche I ended using #mainDiv { text-align: center; width: 55%; background-color: #ffffff; padding: 4px; white-space: nowrap; Thanks
  3. Hello; I want to float a <div> so that it is always centered on the webpage . How can I do this ? <style> body { background-color: #ebe8e4; } #flexBox-container { display: flex; flex-wrap: nowrap; background-color: #fbe9d6; text-align: center; // width: 100%; } </style> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Hello World!</title> <link rel="stylesheet" type="text/css" href="./styles.css"> </head> <body> <div id="flexBox-container"> &l
  4. I am not using: How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process Ask Question. So it is not pertinent to me . I gave these links , just in case you are not proficient with webview/BrowserView in Electron , to give you some context for this question . https://www.electronjs.org/docs/api/webview-tag Recommends not using webview any more . This is the recommended way: https://www.electronjs.org/docs/api/browser-view
  5. Yes it is here: ttps://www.electronjs.org/docs/api/webview-tag
  6. Thanks dsonesuk ; I am using BrowserView not webview , and I am doing it in main.js , not in renderer.js . https://www.electronjs.org/docs/api/webview-tag Recommends not using webview any more . This is the recommended way: https://www.electronjs.org/docs/api/browser-view My whole main.js code: const electron = require("electron") ; const app = electron.app ; const path = require('path') ; const url = require('url') ; const { BrowserView, BrowserWindow } = require('electron') ; app.on('ready', function() { const win = new BrowserWindow( {width: 600, height:
  7. Hello; I am getting error: "Uncaught exception: Type error: BrowserView is not a constructor" ?? on this line: const view = new BrowserView( ) ; in code below ; I can't figure out why , because the line above is basically the same: const win = new BrowserWindow( {width: 600, height: 600, webPreferences: {nodeIntegration: true} }) Thanks const { BrowserView, BrowserWindow } = require('electron') ; app.on('ready', function() { const win = new BrowserWindow( {width: 600, height: 600, webPreferences: {nodeIntegration: true} }) ; const view = new Brow
  8. It took me a while , but here's the code; <!DOCTYPE html> <html> <head> <title> AddEventListener-For-A-Tag-Stop-Navigation </title> <script> function CreateJsListener() { document.querySelector('a').addEventListener('click', function(event) {Redirect(event) } ) } ; </script> </head> <body onload="CreateJsListener()"> <a href="https://www.google.com"> https://www.google.com </a> <script> var timesThru = 0 ; function Redirect(event) { event.preventDefault() ; window.open("NOT-A-SafeSite.html"); time
  9. Ah..... Finally; <!DOCTYPE html> <html> <head> <title> AddEventListener-For-A-Tag-Stop-Navigation </title> <script> function CreateJsListener() { document.querySelector('a').addEventListener('click', function(event) {Redirect(event) } ) } ; </script> </head> <body onload="CreateJsListener()"> <a href="https://www.google.com"> https://www.google.com </a> <script> var timesThru = 0 ; function Redirect(event) { event.preventDefault() ; window.open("NOT-A-SafeSite.html"); timesThru = timesThru + 1 ; }
  10. Thanks ishan_shah ; I had tried this: window.open('https://www.duckduckgo.com' ; 'target= "_blank" ') But couldn't find the proper format . Turns out my code above doesn't work , but this works except for one issue: <!DOCTYPE html> <html> <head> <script> function AddEventListner(){ var timesThru = 0; document.querySelector('a').addEventListener('click', event => { if (timesThru > 0 ) { alert('Opening SecondPage() , timesThru = ' + timesThru ) window.open('https://www.duckduckgo.com', '_blank'); // keeps page one active // window.l
  11. Thanks Ingolme; Yes , this works perfectly , the 'href' allows me to keep current window open: <!DOCTYPE html> <head> <script> function AddEventListner(){ document.querySelector('a').addEventListener('click', event => { OpenSecondPage() }); } </script> <head> </html> <body onload="AddEventListner"()> <a href="https://www.w3schools.com" target="_blank">Visit W3Schools</a> <script> function OpenSecondPage() { window.location.href = "https://www.duckduckgo.com"; // default page }; </script> </body> </html>
  12. Tia; Trying to redirect from one page to another page and still leave 1st page open . This works except that it closes 1st page: window.location.href = "https://www.w3schools.com "; // works fine This doesn't work at all: window.location.href = "https://www.w3schools.com target="_blank" "; // doesn't work Full code: <!DOCTYPE html> <html> <head> <script> function CreateJsListener() { document.querySelector('a').onclick = Redirect(); } </script> </head> <body onload="CreateJsListener()"> <a hr
  13. function SpecificSiteLinks(navigateTo) { SafeSite = false ; for (var i = 0; i < specificSiteLinksArray.length; i++) { if (specificSiteLinksArray[i] == navigateTo) { SafeSite = true ; alert("SpecificSiteLinks SafeSite = true " + "navigateTo = " + navigateTo); break ; }else { SafeSite = false ; } } if (SafeSite == false) { alert("SpecificSiteLinks SafeSite = false "+ "navigateTo = " + navigateTo); } } Ok , I see it now , Thanks
  14. It keeps looping this message : alert("SpecificSiteLinks SafeSite = false "+ "navigateTo = " + navigateTo);
  15. Tia ; I need more eyes : Can't figure out my error in function SpecificSiteLinks(navigateTo) . What am I doing wrong , Thanks for your Help... <!DOCTYPE html> <html> <head> <style> span.buttons { display: inline; /* the default for span */ padding: 5px; } p { border: 1px solid blue; } </style> </head> <body> <div style="text-align: center"> <input type="text" placeholder="Enter URL" id="myInput" value="http://www.google.com"> <button type="button" onclick="getInputValue()" >Get URL</button&g
  16. Tia ; I want to change all fontWeight of <p and <div>> to bold . <!DOCTYPE html> <html> <head> <title>Bold Text Demo</title> </head> <body> <p> This is a sample paragraph </p> <button id="button"> Make Bold </button> <div>This is a sample div</div> <script> //Get the button element var btn = document.getElementById('button'); //Get paragraph element var makeBold = document.querySelectorAll(p , div); //Define an click event listener on button
  17. Thanks empressia ; You certainly have gone the extra mile .
  18. Tia ; Getting errors getElementByTagName-ChangeBlankToSelf.html:24 Uncaught TypeError: Cannot read property 'getAttribute' of undefined at ChangeBlankToSelf (getElementByTagName-ChangeBlankToSelf.html:24) at HTMLButtonElement.onclick (getElementByTagName-ChangeBlankToSelf.html:17) with the following code <!DOCTYPE html> <html> <head> </head> <body> <h4>getElementByTagName-ChangeBlankToSelf.html</h4> <p> <a href="https://www.w3schools.com" target="_blank">Visit W3Schools</a> <br> <a href="https://www
  19. Oops! Sorry I remembered , , <a href="#calibre_link-1"> Thanks
  20. Hello & Thanks ; I have been working on my KidsafeBrowser , in .vb . Sorry . I have forgotten How to do this: Using Calibre I Converted a .pdf into .html . I have a html file : ~reads/Communion-with-God-Son-HolySpirit-ESV.html WIth quite a few in page links and Calibre does this: <p class="calibre1"><a href="file:///C:/Users/vmars/Calibre%20Library/William%20H.%20Gross/Owen%20Communion%20with%20God%20(4)/Of-Communion-with-God-Owen_Gross.html#calibre_link-1"><b class="calibre2">EDITOR’S PREFACE ...............................................
  21. That doesnt work for me : I havent been back here for a long time . So didnt notice your Post. I needed two tables side by side by side , such that I could select/copy each table as a column , without effecting the other Tab I ended up doing this: <!doctype html> <html> <head> <title></title> <style> table{ table-layout: fixed; background-color: rgb(232, 230 , 228); width: 100%; border-style: solid; border-width: 3px; border-color: maroon; } .table01 { text-align: left; width: 100%; } .table02 { text-align: left
  22. Yes , and I can select/copy each Table individually . Thanks What I don't like is that if I hit enter-key It creates what loos like a whole line . Is there a way to stop it from creating a whole new colored line , it looks like a whole new paragraph (sort of) . And keep enter-key text in the same line . I could ignore the enter-key with .js , but then how would I create a new line ? Type in blanks til I overflow to a new line ? Thanks
  23. Ah...What a relief , Thank You Very Much
  24. Thanks ; JMRKR "What does the desired output look like?" Here is exactly how I would like it to behave : <!DOCTYPE html> <html> <style> .Lcol { } .Rcol { } </style> <body> <h4>Editable-Simple-P.html Needs Copy Button + Which Col InputBox</h4> <p class="Lcol " contentEditable = "true" style="display: inline-block; background: yellow; width:45%;">This is a paragraph 1. Lcol</p> <p class="Rcol " contentEditable = "true" style="display: inline-block; background: lightblue; width:45%;">This is a paragraph 4. Rcol<hr>
×
×
  • Create New...