# Are external HTML files and Ruby files into the plug-in allowed?

**URL:** <https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770>\
**Category:** Ruby API\
**Created:** [March 21, 2021, 2:54am UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770 "2021-03-21T02:54:59Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidshawn](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@davidshawn](https://forums.sketchup.com/u/davidshawn)\
**Post date:** [March 21, 2021, 2:54am UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/1 "2021-03-21T02:54:59Z")

</div>

I am using webdialog write a plugin, for easy to update, I want reference some files such as html files, ruby files and so on, which are located in a serve-side.  
Then, users download the plugin once time and will get the latest version every time.

---

<div class="post-metadata">

**Author:** ![dezmo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/dezmo/32/51058_2.png) [@dezmo](https://forums.sketchup.com/u/dezmo)\
**Post date:** [March 21, 2021, 9:30am UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/2 "2021-03-21T09:30:21Z")

</div>

General:

1. I have been moved the topic to right category

2. Your profile have some misleading information:  
 ![image](https://global.discourse-cdn.com/sketchup/original/3X/1/a/1ae4a50d8512c7265fd8a5892ab6688f98d5f5eb.png)

- extension can not run in any web version of SU (If you are using extensions you should have desktop version of SU)
- there is no 2020 version of SU web
- There is no operating system “mos”
- graphics card can be better described

Would you please so kind to correct it!

* * *

… back to your question:  
For example [The Engineering ToolBox](https://extensions.sketchup.com/extension/99d3eb24-a56f-4c3e-b7cb-3550cd9d2aca/the-engineering-tool-box) is done by such a way…

At least I **guess** it is a plugin that uses a js call and [eval method](https://ruby-doc.org/core-2.7.1/Kernel.html#method-i-eval) to download components…

> [@davidshawn](#):
>
> I am using webdialog write a plugin

[WebDialog](https://ruby.sketchup.com/UI/WebDialog.html) is **Deprecated.**

Please use [HtmlDialog](https://ruby.sketchup.com/UI/HtmlDialog.html) that was introduced in SketchUp 2017.

> [@davidshawn](#):
>
> users download the plugin once time and will get the latest version every time

Personally, as user, I prefer to update it myself.

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [March 21, 2021, 7:50pm UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/3 "2021-03-21T19:50:37Z")

</div>

HtmlDialogs can open server side websites (HTML, JavaScript and CSS files.)

The API does **not** directly define a mechanism for downloading and updating individual Ruby files on the fly.

But it does have methods to install extension RBZ (zip) pakages for entire extension:

- [`Sketchup::install_from_archive()`](https://ruby.sketchup.com/Sketchup.html#install_from_archive-class_method)

You might be able to use [`Sketchup::Http::Request`](https://ruby.sketchup.com/Sketchup/Http/Request.html) class to download the package.  
Or one of the Ruby libraries. Like:

- [`Net::HTTP`](https://ruby-doc.org/stdlib-2.7.1/libdoc/net/http/rdoc/Net/HTTP.html)
- [`Net::FTP`](https://ruby-doc.org/stdlib-2.7.1/libdoc/net/ftp/rdoc/Net/FTP.html)

---

<div class="post-metadata">

**Author:** ![davidshawn](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@davidshawn](https://forums.sketchup.com/u/davidshawn)\
**Post date:** [March 22, 2021, 12:08am UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/4 "2021-03-22T00:08:33Z")

</div>

> [@dezmo](#):
>
> Please use [HtmlDialog](https://ruby.sketchup.com/UI/HtmlDialog.html) that was introduced in SketchUp 2017.

Yes, it is a clerical error. HtmlDialog Thank you!

---

<div class="post-metadata">

**Author:** ![davidshawn](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@davidshawn](https://forums.sketchup.com/u/davidshawn)\
**Post date:** [March 22, 2021, 12:16am UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/5 "2021-03-22T00:16:04Z")

</div>

Dan, you are amazing, You’ve brought my understanding of the SketchUp Ruby API one step closer

---

<div class="post-metadata">

**Author:** ![Aerilius](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Aerilius](https://forums.sketchup.com/u/Aerilius)\
**Post date:** [March 22, 2021, 11:38am UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/6 "2021-03-22T11:38:44Z")

</div>

> [@dezmo](#):
>
> [eval method](https://ruby-doc.org/core-2.7.1/Kernel.html#method-i-eval)

Once the website being hacked, users’ personal files can be deleted without warning. I’m wondering why that specific extension has not been put down from EWH, since it loads remote code that can be changed without further review by the SketchUp team, while still giving users the false feeling of safety that it initially was reviewed.

> [@davidshawn](#):
>
> I want reference some files such as html files

Static files, images, unprivileged UI code (HTML/JavaScript running sandboxed in browser dialog) ok, but I’d strongly advice against code that runs privileged (Ruby). Ruby code has unrestricted access to user files (read secrets, send over network, delete files). SketchUp allows its developers to submit extension updates through a save mechanism, make use of it. Also consider that users may want to use your extension while being offline.

---

<div class="post-metadata">

**Author:** ![tt\_su](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/tt_su/32/17_2.png) [@tt\_su](https://forums.sketchup.com/u/tt_su)\
**Post date:** [March 23, 2021, 3:02pm UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/7 "2021-03-23T15:02:26Z")

</div>

> [@Aerilius](#):
>
> Static files, images, unprivileged UI code (HTML/JavaScript running sandboxed in browser dialog) ok, but I’d strongly advice against code that runs privileged (Ruby). Ruby code has unrestricted access to user files (read secrets, send over network, delete files). SketchUp allows its developers to submit extension updates through a save mechanism, make use of it. Also consider that users may want to use your extension while being offline.

+1 to all of this.

> [@Aerilius](#):
>
> I’m wondering why that specific extension has not been put down from EWH, since it loads remote code that can be changed without further review by the SketchUp team, while still giving users the false feeling of safety that it initially was reviewed.

Thank you for bringing this to our attention. We’ll be doing a new audit of this extension reviewing what it’s doing.

> [@davidshawn](#):
>
> Then, users download the plugin once time and will get the latest version every time.

Any reason you don’t want to rely on the extension update mechanism already in place in SketchUp via Extension Warehouse?

---

<div class="post-metadata">

**Author:** ![davidshawn](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@davidshawn](https://forums.sketchup.com/u/davidshawn)\
**Post date:** [March 24, 2021, 12:53am UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/8 "2021-03-24T00:53:10Z")

</div>

You kown, in CN, many users can not visit server that in foreign countries smoothly…

---

<div class="post-metadata">

**Author:** ![tt\_su](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/tt_su/32/17_2.png) [@tt\_su](https://forums.sketchup.com/u/tt_su)\
**Post date:** [March 24, 2021, 12:29pm UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/9 "2021-03-24T12:29:05Z")

</div>

Gotcha. So if the EW service was more reliable in China you could be using it?

---

<div class="post-metadata">

**Author:** ![davidshawn](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@davidshawn](https://forums.sketchup.com/u/davidshawn)\
**Post date:** [March 24, 2021, 2:08pm UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/10 "2021-03-24T14:08:27Z")

</div>

> [@tt\_su](#):
>
> Gotcha. So if the EW service was more reliable in China you could be using it?

Yes, I think so, because the key is most users in CN do not have the habit to visit a foreign website, because of language and network speed. It’s a similar situation in 3D warehouse.

But I do have another consideration: In case if I release a new version, I can push some message or tirgue something to limit the older version.

---

<div class="post-metadata">

**Author:** ![tt\_su](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/tt_su/32/17_2.png) [@tt\_su](https://forums.sketchup.com/u/tt_su)\
**Post date:** [March 24, 2021, 2:21pm UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/11 "2021-03-24T14:21:38Z")

</div>

> [@davidshawn](#):
>
> Yes, I think so, because the key is most users in CN do not have the habit to visit a foreign website, because of language and network speed. It’s a similar situation in 3D warehouse.

Good point about the language.

Network speed? Is speed to sites outside of China throttled?

> [@davidshawn](#):
>
> In case if I release a new version, I can push some message or tirgue something to limit the older version.

What did you mean by “tirgue”?

---

<div class="post-metadata">

**Author:** ![davidshawn](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@davidshawn](https://forums.sketchup.com/u/davidshawn)\
**Post date:** [March 24, 2021, 2:35pm UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/12 "2021-03-24T14:35:26Z")

</div>

> [@tt\_su](#):
>
> What did you mean by “tirgue”?

sorry, it was `trigger`  
something like alert window or add a mask layer

---

<div class="post-metadata">

**Author:** ![tt\_su](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/tt_su/32/17_2.png) [@tt\_su](https://forums.sketchup.com/u/tt_su)\
**Post date:** [March 26, 2021, 11:05am UTC](https://forums.sketchup.com/t/are-external-html-files-and-ruby-files-into-the-plug-in-allowed/157770/13 "2021-03-26T11:05:43Z")

</div>

There is `UI::Notification`. SketchUp uses this UI widget to notify about extension updates available from the Extension Warehouse.

[Class: UI::Notification — SketchUp Ruby API Documentation](https://ruby.sketchup.com/UI/Notification.html)

That being said, for my own extensions I use a toolbar button to indicate new versions:

![image](https://global.discourse-cdn.com/sketchup/original/3X/2/1/217e7eca2db030b6c7a012842279c62a3ca66f1d.png)

Notice the little red badge for the right-most button. Clicking that will prompt the user to go to Extension Warehouse or the website to update. It’s simple an unobstrusive.
