<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: KoichiArai</title>
    <description>The latest articles on DEV Community by KoichiArai (@koichiarai).</description>
    <link>https://dev.to/koichiarai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1706022%2F1316c5fc-2231-4fe6-9aa1-d6aebc6b0310.jpg</url>
      <title>DEV Community: KoichiArai</title>
      <link>https://dev.to/koichiarai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/koichiarai"/>
    <language>en</language>
    <item>
      <title>Day 23 of 100DaysOfCode</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Thu, 03 Oct 2024 16:47:16 +0000</pubDate>
      <link>https://dev.to/koichiarai/day-23-of-100daysofcode-2opg</link>
      <guid>https://dev.to/koichiarai/day-23-of-100daysofcode-2opg</guid>
      <description>&lt;p&gt;Hey! It's been a while since last entry.&lt;br&gt;
Recently, I've been tackling an issue related to losing element references within a loop, and I finally found a solution that I'd like to share with you all.&lt;/p&gt;
&lt;h2&gt;
  
  
  What I wanted to achieve
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Collect button elements on a specific webpage.&lt;/li&gt;
&lt;li&gt;Click each buttons to navigate to another page.&lt;/li&gt;
&lt;li&gt;After performing certain actions on the new page, go back to the first page.&lt;/li&gt;
&lt;li&gt;Repeat Steps 2 and 3 until all buttons have been clicked.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's a simplified version of the initial code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const someElements = await page.$$("xpath/ .//foo[@name='hoge']");

for (let i=0; i &amp;lt; someElements.length; i++) {
    await Promise.all([
        someElements[i].click(),
        page.waitForNavigation({ waitUntil: ["load", 'networkidle0'] }),
    /* There are particular processes and going back process */
    ]);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What error I encountered
&lt;/h2&gt;

&lt;p&gt;After the forst loop iteration, the script wasn't able to locate the button elements. I kept getting the following error:&lt;br&gt;
&lt;code&gt;ProtocolError: Protocol error (DOM.describeNode): Cannot find context with specified id at &amp;lt;instance_members_initializer&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How I solved it
&lt;/h2&gt;

&lt;p&gt;I resolved this issue by re-declaring the button elements list within the loop.&lt;br&gt;
Here's the modified code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const someElements1 = await page.$$("xpath/ .//foo[@name='hoge']");

for (let i=0; i &amp;lt; someElements.length; i++) {
    const someElements2 = await page.$$("xpath/ .//foo[@name='hoge']"); // added row
    await Promise.all([
        someElements2[i].click(),
        page.waitForNavigation({ waitUntil: ["load", 'networkidle0'] }),
    /* There are particular processes and going back process */
    ]);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I added re-declaration line because I assumed the original &lt;code&gt;someElements&lt;/code&gt; reference was getting lost when navigating away from the initial page. After this change, the error was resolved. However, I'm not sure if this approach strictly adheres to best coding practices.&lt;/p&gt;

&lt;p&gt;If you encounter an issue with &lt;code&gt;.click()&lt;/code&gt; in a loop when navigating between pages, consider re-declaring the element within the loop itself. This simple change might save you a lot of troubleshooting time!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day22 of 100DaysOfCode</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Sat, 07 Sep 2024 11:44:09 +0000</pubDate>
      <link>https://dev.to/koichiarai/day22-of-100daysofcode-4hfb</link>
      <guid>https://dev.to/koichiarai/day22-of-100daysofcode-4hfb</guid>
      <description>&lt;p&gt;I'm still working on scraping tasks.&lt;br&gt;
During these tasks, I've picked up a few techniques for specific situations, and I'm nothing them down for future reference.&lt;/p&gt;
&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It's better to use the method &lt;code&gt;.click()&lt;/code&gt; when the targeted element has an attribute like &lt;code&gt;href="Javascript:~"&lt;/code&gt;. This ensures the click action is properly triggered.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When you want to input text into a pre-filled textbox, clear it first by using:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;await page.$eval("selector", element =&amp;gt; element.value = "")&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This will help avoid appending text to the existing value.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The method &lt;code&gt;page.waitForTimeout&lt;/code&gt; doesn't exist. In fact, &lt;code&gt;.waitForTimeout&lt;/code&gt; is deprecated and shouldn't be used.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day21 of 100DaysOfCode</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Thu, 22 Aug 2024 16:33:56 +0000</pubDate>
      <link>https://dev.to/koichiarai/day21-of-100daysofcode-2ego</link>
      <guid>https://dev.to/koichiarai/day21-of-100daysofcode-2ego</guid>
      <description>&lt;p&gt;I have been coding web scraping scripts since Day 20. &lt;br&gt;
Today, I learned a few typical methods for web scraping.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Using waiting method to ensure the webpage fully loads
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// if you used `.click()`
await Promise.all([
    pointOutSomeElements[0].click(),
    page.waitForNavigation({ waitUntil: ["load", 'networkidle0']}), // This line is used as it is.
]);

// if you used `.goto()` 
await page.goto(url, {
    timeout: 0,
    waitUntil: 'networkidle2'
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code block is useful when you encounter an Error like the following:&lt;br&gt;
&lt;strong&gt;Error: Execution context was destroyed, most likely because of a navigation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Executing actions such as &lt;code&gt;.click()&lt;/code&gt; or &lt;code&gt;.goto()&lt;/code&gt; before the navigation is fully completed can lead to this error.&lt;br&gt;
Therefore, it's important to wait for the webpage to finish navigating.&lt;/p&gt;

&lt;p&gt;For more details, you can refer to the links below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/puppeteer/puppeteer/issues/3323" rel="noopener noreferrer"&gt;Execution context was destroyed, most likely because of a navigation #3323&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/55877263/puppeteer-execution-context-was-destroyed-most-likely-because-of-a-navigation" rel="noopener noreferrer"&gt;Puppeteer Execution context was destroyed, most likely because of a navigation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Day20 of 100DaysOfCode</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Sun, 18 Aug 2024 10:02:16 +0000</pubDate>
      <link>https://dev.to/koichiarai/day20-of-100daysofcode-p7j</link>
      <guid>https://dev.to/koichiarai/day20-of-100daysofcode-p7j</guid>
      <description>&lt;p&gt;I've been working on building another program since Day19. (I had to focus on other coding tasks.)&lt;br&gt;
During this coding session, I encountered a few problems and was able to solve some of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges I faced
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;How to use &lt;code&gt;page.waitForXPath(xpath)&lt;/code&gt;
The answer to this issue was found here:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/puppeteer/puppeteer/issues/12485" rel="noopener noreferrer"&gt;"page.waitForXPath is not a function" in 22.10.0 &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The correct usage is to use &lt;code&gt;waitForSelector(xpath/${xpathexpression})&lt;/code&gt; instead.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;SyntaxError: Unexpected token 'export'&lt;/code&gt;&lt;br&gt;
I ran into this error when I used the &lt;code&gt;export&lt;/code&gt; statement in my function code. After trying various solutions, I couldn't figure out how to resolve it. So I decided to switch to using &lt;code&gt;import&lt;/code&gt; instead of &lt;code&gt;require&lt;/code&gt; in my main code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;TypeError: page.$x is not a function&lt;/code&gt;&lt;br&gt;
This was the toughest issue I faced today. Unfortunately, neither ChatGPT nor Google provided a clear solution. i tried various suggestions I found, such as removing and reinstalling Puppeteer, checking the Puppeteer version, and cleaning up dependencies in &lt;code&gt;package.json&lt;/code&gt;, but none of these worked. I still haven't figured out the true cause of this problem.&lt;br&gt;
The instant solution to this issue is here:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/puppeteer/puppeteer/pull/11782" rel="noopener noreferrer"&gt;refactor!: remove $x and waitForXpath #11782&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day19 of 100DaysOfCode</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Fri, 09 Aug 2024 02:11:34 +0000</pubDate>
      <link>https://dev.to/koichiarai/day19-of-100daysofcode-3gha</link>
      <guid>https://dev.to/koichiarai/day19-of-100daysofcode-3gha</guid>
      <description>&lt;p&gt;It's hard to keep coding consistently, especially since I've been working overtime until 10p.m. lately.&lt;br&gt;
(I know it's not great to make excuses, but I'm determined to push through.)&lt;br&gt;
By the way, I added a &lt;code&gt;**contextBridge**&lt;/code&gt; (by including a &lt;code&gt;**preload.js**&lt;/code&gt; file) to the previous program.&lt;br&gt;
However, it doesn't work and I have been trying to solve this issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Added a secure process
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// index.js
const button = document.getElementById("button");
const receive = document.getElementById("receive");
const send = document.getElementById("send");

button.addEventListener('click', async () =&amp;gt; {
    receive.textContent = await window.myAPI.buttonEvent(send.value);// Changed
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// preload.js
const {ipcRenderer, contextBridge} = require('electron');

contextBridge.exposeInMainWorld('myAPI',{
    buttonEvent: (text) =&amp;gt; ipcRenderer.invoke('two-way-com', text),
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'll continue working on solving this problem.&lt;/p&gt;

</description>
      <category>electron</category>
      <category>beginners</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day18 of 100DaysOfCode</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Thu, 01 Aug 2024 15:19:03 +0000</pubDate>
      <link>https://dev.to/koichiarai/day18-of-100daysofcode-pin</link>
      <guid>https://dev.to/koichiarai/day18-of-100daysofcode-pin</guid>
      <description>&lt;p&gt;Today, I made a small program using two-way Inter-Process Communication (IPC).&lt;br&gt;
Then, a defect occurred, and I struggled with it for an hour.&lt;br&gt;
After all, the cause was a mere mistake...(embarrassing!)&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Making small program to learn how two-way IPC behaves&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Extracting text from a textbox on GUI&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Today's deliverables
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// main.js
"use strict"
const { app, BrowserWindow, ipcMain} = require('electron');

function createWindow() {
    const mainWindow = new BrowserWindow({
        width: 400,
        height: 300,
        title: 'IPC App',
        webPreferences: {
            nodeIntegration: true,
            contextIsolation: false,
        }
    });
    ipcMain.handle('two-way-com', async (_e, _arg) =&amp;gt; {
        console.log("_arg:", _arg);
        return _arg;
    });
    mainWindow.loadFile('index.html');
};

app.once('ready', () =&amp;gt; {
    createWindow();
});

app.once('window-all-closed', () =&amp;gt; app.quit());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- index.html --&amp;gt;
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta http-equiv="Content-Security-policy" content="default-src 'self'" /&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, inicial-scale=1.0" /&amp;gt;
    &amp;lt;title&amp;gt;IPC App&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="styles.css"&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h2&amp;gt;Input something&amp;lt;/h2&amp;gt;
    Send to main: &amp;lt;input type="text" id="send"/&amp;gt;
    &amp;lt;button id="button"&amp;gt;Send&amp;lt;/button&amp;gt;
    &amp;lt;p id="receive"&amp;gt;Receive from main&amp;lt;/p&amp;gt;
    &amp;lt;script src="index.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const {ipcRenderer} = require("electron");
const button = document.getElementById("button");
const receive = document.getElementById("receive");
const send = document.getElementById("send");

button.addEventListener('click', async () =&amp;gt; {
    receive.textContent = await ipcRenderer.invoke('two-way-com', send.value); // I mistook `send.value` into `send.textContent` 
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I will try to combine this code with another program.&lt;/p&gt;

</description>
      <category>electron</category>
      <category>beginners</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day12~17 of 100DaysOfCode</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Tue, 30 Jul 2024 15:07:41 +0000</pubDate>
      <link>https://dev.to/koichiarai/day1217-of-100daysofcode-50hp</link>
      <guid>https://dev.to/koichiarai/day1217-of-100daysofcode-50hp</guid>
      <description>&lt;p&gt;I have been struggling with Inter-Process Communication (IPC) for 5 days. (Also dealing with COVID too)&lt;br&gt;
Finally, I have understood how to use methods such as 'ipcRenderer.invoke' and 'ipcMain.handle' a bit.&lt;br&gt;
However, there are still many things to learn.&lt;/p&gt;
&lt;h2&gt;
  
  
  What I did
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Googling about ipcMain.on and event.reply

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.electronjs.org/docs/latest/tutorial/ipc" rel="noopener noreferrer"&gt;Inter Process Communication&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://qiita.com/hibara/items/c59fb6924610fc22a9db" rel="noopener noreferrer"&gt;Basic of Inter Process Communication for Electron(v15.0.0) (JPN)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I couldn't understand event.reply even after using chat-GPT. I referred to the following article and used &lt;code&gt;.invoke&lt;/code&gt; and &lt;code&gt;.handle&lt;/code&gt; instead.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copying and pasting tutorial code and modifying it

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://zenn.dev/sprout2000/books/6f6a0bf2fd301c/viewer/13319" rel="noopener noreferrer"&gt;Main Process and Renderer Process(JPN)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And here is what I made:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// main.js
console.log("Main process working");
console.log("main.js");
"use strict"
const { app, BrowserWindow, ipcMain, dialog} = require('electron');
const path = require('path');
const url = require('url');
let win;

function createWindow() {
    const mainWindow = new BrowserWindow({
        width: 400,
        height: 300,
        title: 'IPC App',
        webPreferences: {
            nodeIntegration: true,
            contextIsolation: false,
        }
    });
    ipcMain.handle('open-dialog', async (_e, _arg) =&amp;gt; {
        return "hogehoge"
            // .showOpenDialog(mainWindow, {
            //     properties: ['openFile'],
            // })
            // .then((result) =&amp;gt; {
            //     if (result.cancelled) return "Cancelled hoge";
            //     return "hoge";
            // });
    });
    mainWindow.loadFile('index.html');
};


app.once('ready', () =&amp;gt; {
    createWindow();
});

app.once('window-all-closed', () =&amp;gt; app.quit());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- index.html --&amp;gt;
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta http-equiv="Content-Security-policy" content="default-src 'self'" /&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, inicial-scale=1.0" /&amp;gt;
    &amp;lt;title&amp;gt;IPC App&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="styles.css"&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h2&amp;gt;Input something&amp;lt;/h2&amp;gt;
    URL: &amp;lt;input id="URL"/&amp;gt;
    &amp;lt;button id="errorBtn"&amp;gt;Open&amp;lt;/button&amp;gt;
    &amp;lt;p id="text"&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;script src="index.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const {ipcRenderer} = require("electron");

const Button = document.getElementById("Button");
const text = document.getElementById("text");

errorBtn.addEventListener('click', async () =&amp;gt; {
    console.log("index.js");
    text.textContent = await ipcRenderer.invoke('open-dialog');
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I will try to use the packaging function tomorrow.&lt;/p&gt;

</description>
      <category>electron</category>
      <category>beginners</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day 11 of 100DaysOfCode</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Tue, 23 Jul 2024 15:36:02 +0000</pubDate>
      <link>https://dev.to/koichiarai/day-11-of-100daysofcode-2k9n</link>
      <guid>https://dev.to/koichiarai/day-11-of-100daysofcode-2k9n</guid>
      <description>&lt;h2&gt;
  
  
  What I did
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Learning IPC Communication Methods&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I learned about IPC (Inter-Process Communication) methods today. However, I didn't fully understand how to use these methods. In addition to this, in the tutorial on IPC communication in Electron, I couldn't understand the code block below, especially the portion involving the object and arrow function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contextBridge.exposeInMainWorld('electronAPI', {
  setTitle: (title) =&amp;gt; ipcRenderer.send('set-title', title)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I will solve these question tomorrow.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>electron</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day9,10 of 100DaysOfCode</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Mon, 22 Jul 2024 03:51:34 +0000</pubDate>
      <link>https://dev.to/koichiarai/day910-of-100daysofcode-30n</link>
      <guid>https://dev.to/koichiarai/day910-of-100daysofcode-30n</guid>
      <description>&lt;p&gt;I have set my goals for the 100DaysOfCode challenge. My large goal is to create a tech support system for a friend's company to help prevent it from going bankrupt. My small goal is to understand how to make applications with Electron and React Native. Therefore, I will focus on learning how to make apps with Electron and React Native for the rest of the 100 days.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Built Electron environment
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Watch videos&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=0I_OURgu8Ow" rel="noopener noreferrer"&gt;Electron JS: Build Amazing Desktop Apps&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=RkKS7fINI78" rel="noopener noreferrer"&gt;Making Desktop App using Electron&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Read documents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.electronjs.org/ja/docs/latest" rel="noopener noreferrer"&gt;What is Electron?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;How to make a project on Electron&lt;/li&gt;
&lt;li&gt;Understanding the main process and renderer process in Electron&lt;/li&gt;
&lt;li&gt;How to make a package&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>electron</category>
      <category>beginners</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day8 of 100DaysOfHTML</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Wed, 17 Jul 2024 13:33:30 +0000</pubDate>
      <link>https://dev.to/koichiarai/day8-of-100daysofhtml-ik3</link>
      <guid>https://dev.to/koichiarai/day8-of-100daysofhtml-ik3</guid>
      <description>&lt;p&gt;Go with someone absolutely when you are going to enter mountain.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Begin to watch new video
&lt;a href="https://www.youtube.com/watch?v=kUMe1FH4CHE&amp;amp;list=PLWKjhJtqVAbnSe1qUNMG7AbPmjIG54u88" rel="noopener noreferrer"&gt;Learn HTML&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What HTML means&lt;/li&gt;
&lt;li&gt;↓↓↓
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;&amp;lt;/html&amp;gt;
&amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;
&amp;lt;h2&amp;gt;&amp;lt;/h2&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's better to do something than nothing I hope...&lt;/p&gt;

</description>
      <category>html</category>
      <category>beginners</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day7 of 100DaysOfJavaScript</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Mon, 15 Jul 2024 15:19:38 +0000</pubDate>
      <link>https://dev.to/koichiarai/day7-of-100daysofjavascript-5gm0</link>
      <guid>https://dev.to/koichiarai/day7-of-100daysofjavascript-5gm0</guid>
      <description>&lt;p&gt;I have accomplished watching the video.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Continue watching video
&lt;a href="https://www.youtube.com/watch?v=PkZNo7MFNFg" rel="noopener noreferrer"&gt;Learn JavaScript&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Math.random and Math.floor&lt;/li&gt;
&lt;li&gt;Concise format of defining if statement
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (hoge === hogehoge) {
  return true;
} else {
  return false;
}
// concise format below
return hoge === hogehoge ? true : false;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;object.freeze()&lt;/li&gt;
&lt;li&gt;Arrow function&lt;/li&gt;
&lt;li&gt;.filter()&lt;/li&gt;
&lt;li&gt;.map()&lt;/li&gt;
&lt;li&gt;Rest operator&lt;/li&gt;
&lt;li&gt;Spread operator&lt;/li&gt;
&lt;li&gt;Destructring&lt;/li&gt;
&lt;li&gt;Template literal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I will start to learn HTML and CSS tomorrow.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day6 of 100DaysOfJavaScript</title>
      <dc:creator>KoichiArai</dc:creator>
      <pubDate>Mon, 15 Jul 2024 00:58:00 +0000</pubDate>
      <link>https://dev.to/koichiarai/day6-of-100daysofjavascript-440o</link>
      <guid>https://dev.to/koichiarai/day6-of-100daysofjavascript-440o</guid>
      <description>&lt;p&gt;Lately there are many sudden rain...&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Continue watching video.
&lt;a href="https://www.youtube.com/watch?v=PkZNo7MFNFg" rel="noopener noreferrer"&gt;Learn JavaScript&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Nested arrays&lt;/li&gt;
&lt;li&gt;for and while loop
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (var i = 0; i &amp;lt; 10; i += 2) {
  console.log(i); // 2, 4, 6, 8
}
for (var i = 10; i &amp;gt; 0; i -= 2 ) {
  console.log(i); // 8, 6, 4, 2
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;nested for loop
I have frequently used this when I conducted graduation study.&lt;/li&gt;
&lt;li&gt;Random (Math.random, Math.floor)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>100daysofcode</category>
    </item>
  </channel>
</rss>
