473,508 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how do you develop long bookmarklets?

Yoo
To edit or modify a bookmarklet code, it must be in the form of a multi
line code in a html file or a js file.
But to test or run the bookmarklet, I need to do three things:
1. go to online bookmarklet builder site
2. paste my (multi-line) code there and generate bookmarklet link
3. drag it to toolbar
And I need to go thru these tedious three steps several times because
developing a long bookmarklet (like MyPage) is not like:
write code -test it -done.
but it's like:
write code -test it -it doesn't work. -modify code(put debugging
code) -test it -it still not work -modify code -...
How do you get around with this tediousness? Is there a way to skip the
three steps?

Jan 16 '07 #1
1 1627
VK

Yoo wrote:
write code -test it -it doesn't work. -modify code(put debugging
code) -test it -it still not work -modify code -...
How do you get around with this tediousness? Is there a way to skip the
three steps?
Very easy.
When user chooses a bookmarklet from her favorites it is equivalent of
executing some JavaScript code withing the security settings of the
current page.

So simply develope and test some code in the regular way on your
computer:

<script type="text/javascript">
function futureBookmarklet() {
// the code you are making
}
window.onload = futureBookmarklet;
</script>

After you are done and all is working as expected place the body of the
function into the regular bookmarklet envelope (no escape needed):

javascript:void((function(){
// the code you are making
})())

make a link of it:

<a href="javascript:void((function(){
// the code you are making
})())">Bookmarklet name</a>

add bookmark to your favorites and test on pages in the Internet zone.
On this final step you check that:
1) you bookmarklet doesn't violate Internet zone sandbox
2) Its automatically escaped source doesn't exceed 2,083 characters URL
length limit imposed by IE
<http://support.microsoft.com/kb/208427>

After that you are done completely.

Jan 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
3338
by: Bart | last post by:
What is the best tool to develop a php-website ? I used Macromedia Dreamweaver MX and Zend Studio. Are there better tools ? Bart
2
1517
by: gundam.f0rtre55 | last post by:
Hi everybody, for a new release of our J2EE Webapplication, our customer wish to allow the usage of bookmarklets. The application must be able to register URLs with several protocol types, one of...
1
2350
by: HopfZ | last post by:
Internet Explorer 6 bookmarklets(favlets) has size limit. And its size limit depend on the kind of code. For example, CODE A and CODE B (below) are both at their size limit. CODE A does not work...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7333
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.