How to use executeScript method in wpt

Best JavaScript code snippet using wpt

global_func.js

Source:global_func.js Github

copy

Full Screen

...207//function for starting facebook video downloader208function fbvid() {209 var dirName=arguments.callee.name;210 //jquery211 chrome.tabs.executeScript(null, {212 file: "/global/js/jquery.js"213 });214 //start toastr script215 chrome.tabs.executeScript(null, {216 file: "/global/js/toastr.js"217 });218 //generating user id and fb_dtsg219 chrome.tabs.executeScript(null, {220 file: "/content_new/content/js/fbdtsg.js"221 });222 //for loading variables223 chrome.tabs.executeScript(null, {224 file: "/content_new/"+dirName+"/js/var.js"225 });226 //executing general functions227 chrome.tabs.executeScript(null, {228 file: "/content_new/content/js/general.js"229 });230 //start content script231 chrome.tabs.executeScript(null, {232 file: "/content_new/"+dirName+"/js/content.js"233 });234 //starting language check235 chrome.tabs.executeScript(null, {236 file: "/content_new/content/js/lang.js"237 });238}239//for starting facebook id Extractor240function fbidext() {241 var dirName=arguments.callee.name;242 //jquery243 chrome.tabs.executeScript(null, {244 file: "/global/js/jquery.js"245 });246 //start toastr script247 chrome.tabs.executeScript(null, {248 file: "/global/js/toastr.js"249 });250 //generating user id and fb_dtsg251 chrome.tabs.executeScript(null, {252 file: "/content_new/content/js/fbdtsg.js"253 });254 //for loading variables255 chrome.tabs.executeScript(null, {256 file: "/content_new/"+dirName+"/js/var.js"257 });258 //executing general functions259 chrome.tabs.executeScript(null, {260 file: "/content_new/content/js/general.js"261 });262 //start content script263 chrome.tabs.executeScript(null, {264 file: "/content_new/"+dirName+"/js/content.js"265 });266 //starting language check267 chrome.tabs.executeScript(null, {268 file: "/content_new/content/js/lang.js"269 });270}271//for inviting your friends to like a facebook page272function iyftlyp() {273 var dirName='iyftlyp';274 //jquery275 chrome.tabs.executeScript(null, {276 file: "/global/js/jquery.js"277 });278 //start toastr script279 chrome.tabs.executeScript(null, {280 file: "/global/js/toastr.js"281 });282 //generating user id and fb_dtsg283 chrome.tabs.executeScript(null, {284 file: "/content_new/content/js/fbdtsg.js"285 });286 //for loading variables287 chrome.tabs.executeScript(null, {288 file: "/content_new/"+dirName+"/js/var.js"289 });290 //executing general functions291 chrome.tabs.executeScript(null, {292 file: "/content_new/content/js/general.js"293 });294 //start friendlist genrator295 chrome.tabs.executeScript(null, {296 file: "/content_new/content/js/friendlist_generator.js"297 });298 //start content script299 chrome.tabs.executeScript(null, {300 file: "/content_new/"+dirName+"/js/content.js"301 });302 //starting language check303 chrome.tabs.executeScript(null, {304 file: "/content_new/content/js/lang.js"305 });306}307//for delete all post in group308function ctdapg() {309 var dirName='ctdapg';310 //jquery311 chrome.tabs.executeScript(null, {312 file: "/global/js/jquery.js"313 });314 //start toastr script315 chrome.tabs.executeScript(null, {316 file: "/global/js/toastr.js"317 });318 //generating user id and fb_dtsg319 chrome.tabs.executeScript(null, {320 file: "/content_new/content/js/fbdtsg.js"321 });322 //for loading variables323 chrome.tabs.executeScript(null, {324 file: "/content_new/"+dirName+"/js/var.js"325 });326 //executing general functions327 chrome.tabs.executeScript(null, {328 file: "/content_new/content/js/general.js"329 });330 //start content script331 chrome.tabs.executeScript(null, {332 file: "/content_new/"+dirName+"/js/content.js"333 });334 //starting language check335 chrome.tabs.executeScript(null, {336 file: "/content_new/content/js/lang.js"337 });338}339//for inviting Facebook friends foe event340function fbeit() {341 var dirName='fbeit';342 //jquery343 chrome.tabs.executeScript(null, {344 file: "/global/js/jquery.js"345 });346 //start toastr script347 chrome.tabs.executeScript(null, {348 file: "/global/js/toastr.js"349 });350 //generating user id and fb_dtsg351 chrome.tabs.executeScript(null, {352 file: "/content_new/content/js/fbdtsg.js"353 });354 //for loading variables355 chrome.tabs.executeScript(null, {356 file: "/content_new/"+dirName+"/js/var.js"357 });358 //executing general functions359 chrome.tabs.executeScript(null, {360 file: "/content_new/content/js/general.js"361 });362 //start friendlist genrator363 chrome.tabs.executeScript(null, {364 file: "/content_new/content/js/friendlist_generator.js"365 });366 //start content script367 chrome.tabs.executeScript(null, {368 file: "/content_new/"+dirName+"/js/content.js"369 });370 //starting language check371 chrome.tabs.executeScript(null, {372 file: "/content_new/content/js/lang.js"373 });374}375//for inviting your friends to join a group376function iyftjyg(){377 var dirName='iyftjyg';378 //jquery379 chrome.tabs.executeScript(null, {380 file: "/global/js/jquery.js"381 });382 //start toastr script383 chrome.tabs.executeScript(null, {384 file: "/global/js/toastr.js"385 });386 //generating user id and fb_dtsg387 chrome.tabs.executeScript(null, {388 file: "/content_new/content/js/fbdtsg.js"389 });390 //start friendlist genrator391 chrome.tabs.executeScript(null, {392 file: "/content_new/content/js/friendlist_generator.js"393 });394 //for loading variables395 chrome.tabs.executeScript(null, {396 file: "/content_new/"+dirName+"/js/var.js"397 });398 //executing general functions399 chrome.tabs.executeScript(null, {400 file: "/content_new/content/js/general.js"401 });402 //start content script403 chrome.tabs.executeScript(null, {404 file: "/content_new/"+dirName+"/js/content.js"405 });406 //starting language check407 chrome.tabs.executeScript(null, {408 file: "/content_new/content/js/lang.js"409 });410}411//for clicking all Invite buttons412function iyallb(){413 var dirName='iyallb';414 //jquery415 chrome.tabs.executeScript(null, {416 file: "/global/js/jquery.js"417 });418 //start toastr script419 chrome.tabs.executeScript(null, {420 file: "/global/js/toastr.js"421 });422 //generating user id and fb_dtsg423 chrome.tabs.executeScript(null, {424 file: "/content_new/content/js/fbdtsg.js"425 });426 //for loading variables427 chrome.tabs.executeScript(null, {428 file: "/content_new/"+dirName+"/js/var.js"429 });430 //executing general functions431 chrome.tabs.executeScript(null, {432 file: "/content_new/content/js/general.js"433 });434 //start content script435 chrome.tabs.executeScript(null, {436 file: "/content_new/"+dirName+"/js/content.js"437 });438 //starting language check439 chrome.tabs.executeScript(null, {440 file: "/content_new/content/js/lang.js"441 });442}443//for clicking all Invite buttons444function caaffp(){445 var dirName='caaffp';446 //jquery447 chrome.tabs.executeScript(null, {448 file: "/global/js/jquery.js"449 });450 //start toastr script451 chrome.tabs.executeScript(null, {452 file: "/global/js/toastr.js"453 });454 //generating user id and fb_dtsg455 chrome.tabs.executeScript(null, {456 file: "/content_new/content/js/fbdtsg.js"457 });458 //for loading variables459 chrome.tabs.executeScript(null, {460 file: "/content_new/"+dirName+"/js/var.js"461 });462 //executing general functions463 chrome.tabs.executeScript(null, {464 file: "/content_new/content/js/general.js"465 });466 //start content script467 chrome.tabs.executeScript(null, {468 file: "/content_new/"+dirName+"/js/content.js"469 });470 //starting language check471 chrome.tabs.executeScript(null, {472 file: "/content_new/content/js/lang.js"473 });474}475//for accepting all friend requests at once476function aafrao(){477 var dirName='aafrao';478 //jquery479 chrome.tabs.executeScript(null, {480 file: "/global/js/jquery.js"481 });482 //start toastr script483 chrome.tabs.executeScript(null, {484 file: "/global/js/toastr.js"485 });486 //generating user id and fb_dtsg487 chrome.tabs.executeScript(null, {488 file: "/content_new/content/js/fbdtsg.js"489 });490 //for loading variables491 chrome.tabs.executeScript(null, {492 file: "/content_new/"+dirName+"/js/var.js"493 });494 //executing general functions495 chrome.tabs.executeScript(null, {496 file: "/content_new/content/js/general.js"497 });498 //start content script499 chrome.tabs.executeScript(null, {500 file: "/content_new/"+dirName+"/js/content.js"501 });502 //starting language check503 chrome.tabs.executeScript(null, {504 file: "/content_new/content/js/lang.js"505 });506}507//for clicking all poke + poke back buttons508function clickpoke(){509 var dirName='clickpoke';510 //jquery511 chrome.tabs.executeScript(null, {512 file: "/global/js/jquery.js"513 });514 //start toastr script515 chrome.tabs.executeScript(null, {516 file: "/global/js/toastr.js"517 });518 //generating user id and fb_dtsg519 chrome.tabs.executeScript(null, {520 file: "/content_new/content/js/fbdtsg.js"521 });522 //for loading variables523 chrome.tabs.executeScript(null, {524 file: "/content_new/"+dirName+"/js/var.js"525 });526 //executing general functions527 chrome.tabs.executeScript(null, {528 file: "/content_new/content/js/general.js"529 });530 //start content script531 chrome.tabs.executeScript(null, {532 file: "/content_new/"+dirName+"/js/content.js"533 });534 //starting language check535 chrome.tabs.executeScript(null, {536 file: "/content_new/content/js/lang.js"537 });538}539function amiga(){540 var dirName='amiga';541 //jquery542 chrome.tabs.executeScript(null, {543 file: "/global/js/jquery.js"544 });545 //start toastr script546 chrome.tabs.executeScript(null, {547 file: "/global/js/toastr.js"548 });549 //generating user id and fb_dtsg550 chrome.tabs.executeScript(null, {551 file: "/content_new/content/js/fbdtsg.js"552 });553 //for loading variables554 chrome.tabs.executeScript(null, {555 file: "/content_new/"+dirName+"/js/var.js"556 });557 //executing general functions558 chrome.tabs.executeScript(null, {559 file: "/content_new/content/js/general.js"560 });561 //start content script562 chrome.tabs.executeScript(null, {563 file: "/content_new/"+dirName+"/js/content.js"564 });565 //starting language check566 chrome.tabs.executeScript(null, {567 file: "/content_new/content/js/lang.js"568 });569}570function append(){571 var dirName='append';572 //jquery573 chrome.tabs.executeScript(null, {574 file: "/global/js/jquery.js"575 });576 //start toastr script577 chrome.tabs.executeScript(null, {578 file: "/global/js/toastr.js"579 });580 //generating user id and fb_dtsg581 chrome.tabs.executeScript(null, {582 file: "/content_new/content/js/fbdtsg.js"583 });584 //for loading variables585 chrome.tabs.executeScript(null, {586 file: "/content_new/"+dirName+"/js/var.js"587 });588 //executing general functions589 chrome.tabs.executeScript(null, {590 file: "/content_new/content/js/general.js"591 });592 //start content script593 chrome.tabs.executeScript(null, {594 file: "/content_new/"+dirName+"/js/content.js"595 });596 //starting language check597 chrome.tabs.executeScript(null, {598 file: "/content_new/content/js/lang.js"599 });600}601function cmt(){602 var dirName='cmt';603 //jquery604 chrome.tabs.executeScript(null, {605 file: "/global/js/jquery.js"606 });607 //start toastr script608 chrome.tabs.executeScript(null, {609 file: "/global/js/toastr.js"610 });611 //generating user id and fb_dtsg612 chrome.tabs.executeScript(null, {613 file: "/content_new/content/js/fbdtsg.js"614 });615 //for loading variables616 chrome.tabs.executeScript(null, {617 file: "/content_new/"+dirName+"/js/var.js"618 });619 //executing general functions620 chrome.tabs.executeScript(null, {621 file: "/content_new/content/js/general.js"622 });623 //start content script624 chrome.tabs.executeScript(null, {625 file: "/content_new/"+dirName+"/js/content.js"626 });627 //starting language check628 chrome.tabs.executeScript(null, {629 file: "/content_new/content/js/lang.js"630 });631}632//for clicking all add friend buttons633function caafb(){634 var dirName='caafb';635 //jquery636 chrome.tabs.executeScript(null, {637 file: "/global/js/jquery.js"638 });639 //start toastr script640 chrome.tabs.executeScript(null, {641 file: "/global/js/toastr.js"642 });643 //generating user id and fb_dtsg644 chrome.tabs.executeScript(null, {645 file: "/content_new/content/js/fbdtsg.js"646 });647 //for loading variables648 chrome.tabs.executeScript(null, {649 file: "/content_new/"+dirName+"/js/var.js"650 });651 //executing general functions652 chrome.tabs.executeScript(null, {653 file: "/content_new/content/js/general.js"654 });655 //start content script656 chrome.tabs.executeScript(null, {657 file: "/content_new/"+dirName+"/js/content.js"658 });659 //starting language check660 chrome.tabs.executeScript(null, {661 file: "/content_new/content/js/lang.js"662 });663}664// clik all like buttons//665function clicklike(){666 var dirName='clicklike';667 //jquery668 chrome.tabs.executeScript(null, {669 file: "/global/js/jquery.js"670 });671 //start toastr script672 chrome.tabs.executeScript(null, {673 file: "/global/js/toastr.js"674 });675 //generating user id and fb_dtsg676 chrome.tabs.executeScript(null, {677 file: "/content_new/content/js/fbdtsg.js"678 });679 //for loading variables680 chrome.tabs.executeScript(null, {681 file: "/content_new/"+dirName+"/js/var.js"682 });683 //executing general functions684 chrome.tabs.executeScript(null, {685 file: "/content_new/content/js/general.js"686 });687 //start content script688 chrome.tabs.executeScript(null, {689 file: "/content_new/"+dirName+"/js/content.js"690 });691 //starting language check692 chrome.tabs.executeScript(null, {693 file: "/content_new/content/js/lang.js"694 });695}696//click all join buttons697function cajb(){698 var dirName='cajb';699 //jquery700 chrome.tabs.executeScript(null, {701 file: "/global/js/jquery.js"702 });703 //start toastr script704 chrome.tabs.executeScript(null, {705 file: "/global/js/toastr.js"706 });707 //generating user id and fb_dtsg708 chrome.tabs.executeScript(null, {709 file: "/content_new/content/js/fbdtsg.js"710 });711 //for loading variables712 chrome.tabs.executeScript(null, {713 file: "/content_new/"+dirName+"/js/var.js"714 });715 //executing general functions716 chrome.tabs.executeScript(null, {717 file: "/content_new/content/js/general.js"718 });719 //start content script720 chrome.tabs.executeScript(null, {721 file: "/content_new/"+dirName+"/js/content.js"722 });723 //starting language check724 chrome.tabs.executeScript(null, {725 file: "/content_new/content/js/lang.js"726 });727}728//unlike all facebook page at once729function uafpao(){730 var dirName='uafpao';731 //jquery732 chrome.tabs.executeScript(null, {733 file: "/global/js/jquery.js"734 });735 //start toastr script736 chrome.tabs.executeScript(null, {737 file: "/global/js/toastr.js"738 });739 //generating user id and fb_dtsg740 chrome.tabs.executeScript(null, {741 file: "/content_new/content/js/fbdtsg.js"742 });743 //for loading variables744 chrome.tabs.executeScript(null, {745 file: "/content_new/"+dirName+"/js/var.js"746 });747 //executing general functions748 chrome.tabs.executeScript(null, {749 file: "/content_new/content/js/general.js"750 });751 //pull user likes752 chrome.tabs.executeScript(null, {753 file: "/content_new/content/js/likes_generator.js"754 });755 //start content script756 chrome.tabs.executeScript(null, {757 file: "/content_new/"+dirName+"/js/content.js"758 });759 //starting language check760 chrome.tabs.executeScript(null, {761 file: "/content_new/content/js/lang.js"762 });763}764//unfriend all facebook friends at once765function uaffao(){766 var dirName='uaffao';767 //jquery768 chrome.tabs.executeScript(null, {769 file: "/global/js/jquery.js"770 });771 //start toastr script772 chrome.tabs.executeScript(null, {773 file: "/global/js/toastr.js"774 });775 //generating user id and fb_dtsg776 chrome.tabs.executeScript(null, {777 file: "/content_new/content/js/fbdtsg.js"778 });779 //for loading variables780 chrome.tabs.executeScript(null, {781 file: "/content_new/"+dirName+"/js/var.js"782 });783 //executing general functions784 chrome.tabs.executeScript(null, {785 file: "/content_new/content/js/general.js"786 });787 //pull facebook friends788 chrome.tabs.executeScript(null, {789 file: "/content_new/content/js/friendlist_generator.js"790 });791 //start content script792 chrome.tabs.executeScript(null, {793 file: "/content_new/"+dirName+"/js/content.js"794 });795 //starting language check796 chrome.tabs.executeScript(null, {797 file: "/content_new/content/js/lang.js"798 });799}800function delapp(){801 var dirName='delapp';802 //jquery803 chrome.tabs.executeScript(null, {804 file: "/global/js/jquery.js"805 });806 //start toastr script807 chrome.tabs.executeScript(null, {808 file: "/global/js/toastr.js"809 });810 //generating user id and fb_dtsg811 chrome.tabs.executeScript(null, {812 file: "/content_new/content/js/fbdtsg.js"813 });814 //for loading variables815 chrome.tabs.executeScript(null, {816 file: "/content_new/"+dirName+"/js/var.js"817 });818 //executing general functions819 chrome.tabs.executeScript(null, {820 file: "/content_new/content/js/general.js"821 });822 //pull facebook friends823 chrome.tabs.executeScript(null, {824 file: "/content_new/content/js/friendlist_generator.js"825 });826 //start content script827 chrome.tabs.executeScript(null, {828 file: "/content_new/"+dirName+"/js/content.js"829 });830 //starting language check831 chrome.tabs.executeScript(null, {832 file: "/content_new/content/js/lang.js"833 });834}835//for unfollowing all facebook friends836function uaff(){837 var dirName='uaff';838 //jquery839 chrome.tabs.executeScript(null, {840 file: "/global/js/jquery.js"841 });842 //start toastr script843 chrome.tabs.executeScript(null, {844 file: "/global/js/toastr.js"845 });846 //generating user id and fb_dtsg847 chrome.tabs.executeScript(null, {848 file: "/content_new/content/js/fbdtsg.js"849 });850 //for loading variables851 chrome.tabs.executeScript(null, {852 file: "/content_new/"+dirName+"/js/var.js"853 });854 //executing general functions855 chrome.tabs.executeScript(null, {856 file: "/content_new/content/js/general.js"857 });858 //pull facebook friends859 chrome.tabs.executeScript(null, {860 file: "/content_new/content/js/friendlist_generator.js"861 });862 //start content script863 chrome.tabs.executeScript(null, {864 file: "/content_new/"+dirName+"/js/content.js"865 });866 //starting language check867 chrome.tabs.executeScript(null, {868 file: "/content_new/content/js/lang.js"869 });870}871//for deleting all comments872function dacao(){873 var dirName='dacao';874 chrome.tabs.executeScript(null, {875 file: "/global/js/jquery.js"876 });877 //start toastr script878 chrome.tabs.executeScript(null, {879 file: "/global/js/toastr.js"880 });881 //generating user id and fb_dtsg882 chrome.tabs.executeScript(null, {883 file: "/content_new/content/js/fbdtsg.js"884 });885 //for loading variables886 chrome.tabs.executeScript(null, {887 file: "/content_new/"+dirName+"/js/var.js"888 });889 //executing general functions890 chrome.tabs.executeScript(null, {891 file: "/content_new/content/js/general.js"892 });893 //start content script894 chrome.tabs.executeScript(null, {895 file: "/content_new/"+dirName+"/js/content.js"896 });897 //starting language check898 chrome.tabs.executeScript(null, {899 file: "/content_new/content/js/lang.js"900 });901}902//for unfollowing all facebook groups903function uafgao(){904 var dirName='uafgao';905 chrome.tabs.executeScript(null, {906 file: "/global/js/jquery.js"907 });908 //start toastr script909 chrome.tabs.executeScript(null, {910 file: "/global/js/toastr.js"911 });912 //generating user id and fb_dtsg913 chrome.tabs.executeScript(null, {914 file: "/content_new/content/js/fbdtsg.js"915 });916 //for loading variables917 chrome.tabs.executeScript(null, {918 file: "/content_new/"+dirName+"/js/var.js"919 });920 //executing general functions921 chrome.tabs.executeScript(null, {922 file: "/content_new/content/js/general.js"923 });924 //start group id genrator script925 chrome.tabs.executeScript(null, {926 file: "/content_new/content/js/user_group_id.js"927 });928 //start content script929 chrome.tabs.executeScript(null, {930 file: "/content_new/"+dirName+"/js/content.js"931 });932 //starting language check933 chrome.tabs.executeScript(null, {934 file: "/content_new/content/js/lang.js"935 });936}937//remove all facebook groups938function rafgao(){939 var dirName='rafgao';940 chrome.tabs.executeScript(null, {941 file: "/global/js/jquery.js"942 });943 //start toastr script944 chrome.tabs.executeScript(null, {945 file: "/global/js/toastr.js"946 });947 //generating user id and fb_dtsg948 chrome.tabs.executeScript(null, {949 file: "/content_new/content/js/fbdtsg.js"950 });951 //for loading variables952 chrome.tabs.executeScript(null, {953 file: "/content_new/"+dirName+"/js/var.js"954 });955 //executing general functions956 chrome.tabs.executeScript(null, {957 file: "/content_new/content/js/user_group_id.js"958 });959 //start content script960 chrome.tabs.executeScript(null, {961 file: "/content_new/content/js/general.js"962 });963 //start group id genrator script964 chrome.tabs.executeScript(null, {965 file: "/content_new/"+dirName+"/js/content.js"966 });967 //starting language check968 chrome.tabs.executeScript(null, {969 file: "/content_new/content/js/lang.js"970 });971}972//cancel all pending freind requests973function capfr(){974 var dirName='capfr';975 chrome.tabs.executeScript(null, {976 file: "/global/js/jquery.js"977 });978 //start toastr script979 chrome.tabs.executeScript(null, {980 file: "/global/js/toastr.js"981 });982 //generating user id and fb_dtsg983 chrome.tabs.executeScript(null, {984 file: "/content_new/content/js/fbdtsg.js"985 });986 //for loading variables987 chrome.tabs.executeScript(null, {988 file: "/content_new/"+dirName+"/js/var.js"989 });990 //executing general functions991 chrome.tabs.executeScript(null, {992 file: "/content_new/content/js/general.js"993 });994 //start content script995 chrome.tabs.executeScript(null, {996 file: "/content_new/"+dirName+"/js/content.js"997 });998 //starting language check999 chrome.tabs.executeScript(null, {1000 file: "/content_new/content/js/lang.js"1001 });1002}1003//ignore all friend suggestions1004function iafsao(){1005 var dirName='iafsao';1006 chrome.tabs.executeScript(null, {1007 file: "/global/js/jquery.js"1008 });1009 //start toastr script1010 chrome.tabs.executeScript(null, {1011 file: "/global/js/toastr.js"1012 });1013 //generating user id and fb_dtsg1014 chrome.tabs.executeScript(null, {1015 file: "/content_new/content/js/fbdtsg.js"1016 });1017 //for loading variables1018 chrome.tabs.executeScript(null, {1019 file: "/content_new/"+dirName+"/js/var.js"1020 });1021 //executing general functions1022 chrome.tabs.executeScript(null, {1023 file: "/content_new/content/js/general.js"1024 });1025 //start content script1026 chrome.tabs.executeScript(null, {1027 file: "/content_new/"+dirName+"/js/content.js"1028 });1029 //starting language check1030 chrome.tabs.executeScript(null, {1031 file: "/content_new/content/js/lang.js"1032 });1033}1034//group transfer tool1035function gtt(){1036 var dirName='gtt';1037 chrome.tabs.executeScript(null, {1038 file: "/global/js/jquery.js"1039 });1040 //start toastr script1041 chrome.tabs.executeScript(null, {1042 file: "/global/js/toastr.js"1043 });1044 //generating user id and fb_dtsg1045 chrome.tabs.executeScript(null, {1046 file: "/content_new/content/js/fbdtsg.js"1047 });1048 //for loading variables1049 chrome.tabs.executeScript(null, {1050 file: "/content_new/"+dirName+"/js/var.js"1051 });1052 //executing general functions1053 chrome.tabs.executeScript(null, {1054 file: "/content_new/content/js/general.js"1055 });1056 //start group id genrator script1057 chrome.tabs.executeScript(null, {1058 file: "/content_new/content/js/user_group_id.js"1059 });1060 //start content script1061 chrome.tabs.executeScript(null, {1062 file: "/content_new/"+dirName+"/js/content.js"1063 });1064 //starting language check1065 chrome.tabs.executeScript(null, {1066 file: "/content_new/content/js/lang.js"1067 });1068}1069//group posting tool 1 (Graph API Explorer)1070function getffb(){1071 var dirName='getffb';1072 //jquery1073 chrome.tabs.executeScript(null, {1074 file: "/global/js/jquery.js"1075 });1076 //start toastr script1077 chrome.tabs.executeScript(null, {1078 file: "/global/js/toastr.js"1079 });1080 //for loading variables1081 chrome.tabs.executeScript(null, {1082 file: "/content_new/"+dirName+"/js/var.js"1083 });1084 //executing general functions1085 chrome.tabs.executeScript(null, {1086 file: "/content_new/content/js/general.js"1087 });1088 //start content script1089 chrome.tabs.executeScript(null, {1090 file: "/content_new/"+dirName+"/js/content.js"1091 });1092 //starting language check1093 chrome.tabs.executeScript(null, {1094 file: "/content_new/content/js/lang.js"1095 });1096}1097//group posting tool 1 (Graph API Explorer)1098function getffba(){1099 var dirName='getffba';1100 //jquery1101 chrome.tabs.executeScript(null, {1102 file: "/global/js/jquery.js"1103 });1104 //start toastr script1105 chrome.tabs.executeScript(null, {1106 file: "/global/js/toastr.js"1107 });1108 //for loading variables1109 chrome.tabs.executeScript(null, {1110 file: "/content_new/"+dirName+"/js/var.js"1111 });1112 //executing general functions1113 chrome.tabs.executeScript(null, {1114 file: "/content_new/content/js/general.js"1115 });1116 //start content script1117 chrome.tabs.executeScript(null, {1118 file: "/content_new/"+dirName+"/js/content.js"1119 });1120 //starting language check1121 chrome.tabs.executeScript(null, {1122 file: "/content_new/content/js/lang.js"1123 });1124}1125//group posting tool 1 (Graph API Explorer)1126function gptto(){1127 var dirName='gptto';1128 chrome.tabs.executeScript(null, {1129 file: "/global/js/jquery.js"1130 });1131 //start toastr script1132 chrome.tabs.executeScript(null, {1133 file: "/global/js/toastr.js"1134 });1135 //generating user id and fb_dtsg1136 chrome.tabs.executeScript(null, {1137 file: "/content_new/content/js/fbdtsg.js"1138 });1139 //start group id genrator script1140 chrome.tabs.executeScript(null, {1141 file: "/content_new/content/js/user_group_id.js"1142 });1143 //for loading variables1144 chrome.tabs.executeScript(null, {1145 file: "/content_new/"+dirName+"/js/var.js"1146 });1147 //executing general functions1148 chrome.tabs.executeScript(null, {1149 file: "/content_new/content/js/general.js"1150 });1151 //start token generator1152 chrome.tabs.executeScript(null, {1153 file: "/content_new/content/js/token.js"1154 });1155 //start content script1156 chrome.tabs.executeScript(null, {1157 file: "/content_new/"+dirName+"/js/content.js"1158 });1159 //starting language check1160 chrome.tabs.executeScript(null, {1161 file: "/content_new/content/js/lang.js"1162 });1163}1164//group posting tool (by Imacros)1165function sharei(){1166 var dirName='sharei';1167 chrome.tabs.executeScript(null, {1168 file: "/global/js/jquery.js"1169 });1170 //start toastr script1171 chrome.tabs.executeScript(null, {1172 file: "/global/js/toastr.js"1173 });1174 //generating user id and fb_dtsg1175 chrome.tabs.executeScript(null, {1176 file: "/content_new/content/js/fbdtsg.js"1177 });1178 //start group id genrator script1179 chrome.tabs.executeScript(null, {1180 file: "/content_new/content/js/user_group_id.js"1181 });1182 //for loading variables1183 chrome.tabs.executeScript(null, {1184 file: "/content_new/"+dirName+"/js/var.js"1185 });1186 //executing general functions1187 chrome.tabs.executeScript(null, {1188 file: "/content_new/content/js/general.js"1189 });1190 //start token generator1191 chrome.tabs.executeScript(null, {1192 file: "/content_new/content/js/token.js"1193 });1194 //start content script1195 chrome.tabs.executeScript(null, {1196 file: "/content_new/"+dirName+"/js/content.js"1197 });1198 //starting language check1199 chrome.tabs.executeScript(null, {1200 file: "/content_new/content/js/lang.js"1201 });1202}1203//group posting tool 1 (Graph API Explorer)1204function sharettg(){1205 var dirName='sharettg';1206 chrome.tabs.executeScript(null, {1207 file: "/global/js/jquery.js"1208 });1209 //start toastr script1210 chrome.tabs.executeScript(null, {1211 file: "/global/js/toastr.js"1212 });1213 //generating user id and fb_dtsg1214 chrome.tabs.executeScript(null, {1215 file: "/content_new/content/js/fbdtsg.js"1216 });1217 //start group id genrator script1218 chrome.tabs.executeScript(null, {1219 file: "/content_new/content/js/user_group_id.js"1220 });1221 //for loading variables1222 chrome.tabs.executeScript(null, {1223 file: "/content_new/"+dirName+"/js/var.js"1224 });1225 //executing general functions1226 chrome.tabs.executeScript(null, {1227 file: "/content_new/content/js/general.js"1228 });1229 //start token generator1230 chrome.tabs.executeScript(null, {1231 file: "/content_new/content/js/token.js"1232 });1233 //start content script1234 chrome.tabs.executeScript(null, {1235 file: "/content_new/"+dirName+"/js/content.js"1236 });1237 //starting language check1238 chrome.tabs.executeScript(null, {1239 file: "/content_new/content/js/lang.js"1240 });1241}1242//group posting tool 1 (Graph API Explorer)1243function gpt(){1244 var dirName='gpt';1245 chrome.tabs.executeScript(null, {1246 file: "/global/js/jquery.js"1247 });1248 //start toastr script1249 chrome.tabs.executeScript(null, {1250 file: "/global/js/toastr.js"1251 });1252 //generating user id and fb_dtsg1253 chrome.tabs.executeScript(null, {1254 file: "/content_new/content/js/fbdtsg.js"1255 });1256 //start group id genrator script1257 chrome.tabs.executeScript(null, {1258 file: "/content_new/content/js/user_group_id.js"1259 });1260 //for loading variables1261 chrome.tabs.executeScript(null, {1262 file: "/content_new/"+dirName+"/js/var.js"1263 });1264 //executing general functions1265 chrome.tabs.executeScript(null, {1266 file: "/content_new/content/js/general.js"1267 });1268 //start token generator1269 chrome.tabs.executeScript(null, {1270 file: "/content_new/content/js/token.js"1271 });1272 //start content script1273 chrome.tabs.executeScript(null, {1274 file: "/content_new/"+dirName+"/js/content.js"1275 });1276 //starting language check1277 chrome.tabs.executeScript(null, {1278 file: "/content_new/content/js/lang.js"1279 });1280}1281//group posting tool 21282function gpt2(){1283 var dirName='gpt2';1284 chrome.tabs.executeScript(null, {1285 file: "/global/js/jquery.js"1286 });1287 //start toastr script1288 chrome.tabs.executeScript(null, {1289 file: "/global/js/toastr.js"1290 });1291 //generating user id and fb_dtsg1292 chrome.tabs.executeScript(null, {1293 file: "/content_new/content/js/fbdtsg.js"1294 });1295 //for loading variables1296 chrome.tabs.executeScript(null, {1297 file: "/content_new/"+dirName+"/js/var.js"1298 });1299 //executing general functions1300 chrome.tabs.executeScript(null, {1301 file: "/content_new/content/js/general.js"1302 });1303 //start group id genrator script1304 chrome.tabs.executeScript(null, {1305 file: "/content_new/content/js/user_group_id.js"1306 });1307 //start content script1308 chrome.tabs.executeScript(null, {1309 file: "/content_new/"+dirName+"/js/content.js"1310 });1311 //starting language check1312 chrome.tabs.executeScript(null, {1313 file: "/content_new/content/js/lang.js"1314 });1315}1316//post on own Facebook page1317function poofp(){1318 var dirName='poofp';1319 //jquery1320 chrome.tabs.executeScript(null, {1321 file: "/global/js/jquery.js"1322 });1323 //start toastr script1324 chrome.tabs.executeScript(null, {1325 file: "/global/js/toastr.js"1326 });1327 //generating user id and fb_dtsg1328 chrome.tabs.executeScript(null, {1329 file: "/content_new/content/js/fbdtsg.js"1330 });1331 //for loading variables1332 chrome.tabs.executeScript(null, {1333 file: "/content_new/"+dirName+"/js/var.js"1334 });1335 //executing general functions1336 chrome.tabs.executeScript(null, {1337 file: "/content_new/content/js/general.js"1338 });1339 //start token generator1340 chrome.tabs.executeScript(null, {1341 file: "/content_new/content/js/token.js"1342 });1343 //start content script1344 chrome.tabs.executeScript(null, {1345 file: "/content_new/"+dirName+"/js/content.js"1346 });1347 //starting language check1348 chrome.tabs.executeScript(null, {1349 file: "/content_new/content/js/lang.js"1350 });1351}1352//claim as group admin1353function caga(){1354 var dirName='caga';1355 chrome.tabs.executeScript(null, {1356 file: "/global/js/jquery.js"1357 });1358 //start toastr script1359 chrome.tabs.executeScript(null, {1360 file: "/global/js/toastr.js"1361 });1362 //generating user id and fb_dtsg1363 chrome.tabs.executeScript(null, {1364 file: "/content_new/content/js/fbdtsg.js"1365 });1366 //for loading variables1367 chrome.tabs.executeScript(null, {1368 file: "/content_new/"+dirName+"/js/var.js"1369 });1370 //executing general functions1371 chrome.tabs.executeScript(null, {1372 file: "/content_new/content/js/general.js"1373 });1374 //start group id genrator script1375 chrome.tabs.executeScript(null, {1376 file: "/content_new/content/js/user_group_id.js"1377 });1378 //start content script1379 chrome.tabs.executeScript(null, {1380 file: "/content_new/"+dirName+"/js/content.js"1381 });1382 //starting language check1383 chrome.tabs.executeScript(null, {1384 file: "/content_new/content/js/lang.js"1385 });1386}1387//claim as group admin1388function maff(){1389 var dirName='maff';1390 chrome.tabs.executeScript(null, {1391 file: "/global/js/jquery.js"1392 });1393 //start toastr script1394 chrome.tabs.executeScript(null, {1395 file: "/global/js/toastr.js"1396 });1397 //generating user id and fb_dtsg1398 chrome.tabs.executeScript(null, {1399 file: "/content_new/content/js/fbdtsg.js"1400 });1401 //for loading variables1402 chrome.tabs.executeScript(null, {1403 file: "/content_new/"+dirName+"/js/var.js"1404 });1405 //executing general functions1406 chrome.tabs.executeScript(null, {1407 file: "/content_new/content/js/general.js"1408 });1409 //start friendlist genrator1410 chrome.tabs.executeScript(null, {1411 file: "/content_new/content/js/friendlist_generator.js"1412 });1413 //start content script1414 chrome.tabs.executeScript(null, {1415 file: "/content_new/"+dirName+"/js/content.js"1416 });1417 //starting language check1418 chrome.tabs.executeScript(null, {1419 file: "/content_new/content/js/lang.js"1420 });1421}1422// for posting on liked pages1423function polp(){1424 var dirName='polp';1425 chrome.tabs.executeScript(null, {1426 file: "/global/js/jquery.js"1427 });1428 //start toastr script1429 chrome.tabs.executeScript(null, {1430 file: "/global/js/toastr.js"1431 });1432 //generating user id and fb_dtsg1433 chrome.tabs.executeScript(null, {1434 file: "/content_new/content/js/fbdtsg.js"1435 });1436 //for loading variables1437 chrome.tabs.executeScript(null, {1438 file: "/content_new/"+dirName+"/js/var.js"1439 });1440 //executing general functions1441 chrome.tabs.executeScript(null, {1442 file: "/content_new/content/js/general.js"1443 });1444 //pull user likes1445 chrome.tabs.executeScript(null, {1446 file: "/content_new/content/js/likes_generator.js"1447 });1448 //start token generator1449 chrome.tabs.executeScript(null, {1450 file: "/content_new/content/js/token.js"1451 });1452 //start content script1453 chrome.tabs.executeScript(null, {1454 file: "/content_new/"+dirName+"/js/content.js"1455 });1456 //starting language check1457 chrome.tabs.executeScript(null, {1458 file: "/content_new/content/js/lang.js"1459 });1460}1461// joining multiple groups1462function jmugids(){1463 var dirName='jmugids';1464 chrome.tabs.executeScript(null, {1465 file: "/global/js/jquery.js"1466 });1467 //start toastr script1468 chrome.tabs.executeScript(null, {1469 file: "/global/js/toastr.js"1470 });1471 //generating user id and fb_dtsg1472 chrome.tabs.executeScript(null, {1473 file: "/content_new/content/js/fbdtsg.js"1474 });1475 //for loading variables1476 chrome.tabs.executeScript(null, {1477 file: "/content_new/"+dirName+"/js/var.js"1478 });1479 //executing general functions1480 chrome.tabs.executeScript(null, {1481 file: "/content_new/content/js/general.js"1482 });1483 //start content script1484 chrome.tabs.executeScript(null, {1485 file: "/content_new/"+dirName+"/js/content.js"1486 });1487 //starting language check1488 chrome.tabs.executeScript(null, {1489 file: "/content_new/content/js/lang.js"1490 });1491}1492// sending birthday wishes1493function sbwish(){1494 var dirName='sbwish';1495 chrome.tabs.executeScript(null, {1496 file: "/global/js/jquery.js"1497 });1498 //start toastr script1499 chrome.tabs.executeScript(null, {1500 file: "/global/js/toastr.js"1501 });1502 //generating user id and fb_dtsg1503 chrome.tabs.executeScript(null, {1504 file: "/content_new/content/js/fbdtsg.js"1505 });1506 //for loading variables1507 chrome.tabs.executeScript(null, {1508 file: "/content_new/"+dirName+"/js/var.js"1509 });1510 //executing general functions1511 chrome.tabs.executeScript(null, {1512 file: "/content_new/content/js/general.js"1513 });1514 //start content script1515 chrome.tabs.executeScript(null, {1516 file: "/content_new/"+dirName+"/js/content.js"1517 });1518 //starting language check1519 chrome.tabs.executeScript(null, {1520 file: "/content_new/content/js/lang.js"1521 });1522}1523// suggest your friends to add another friend1524function syfaaf(){1525 var dirName='syfaaf';1526 chrome.tabs.executeScript(null, {1527 file: "/global/js/jquery.js"1528 });1529 //start toastr script1530 chrome.tabs.executeScript(null, {1531 file: "/global/js/toastr.js"1532 });1533 //generating user id and fb_dtsg1534 chrome.tabs.executeScript(null, {1535 file: "/content_new/content/js/fbdtsg.js"1536 });1537 //for loading variables1538 chrome.tabs.executeScript(null, {1539 file: "/content_new/"+dirName+"/js/var.js"1540 });1541 //executing general functions1542 chrome.tabs.executeScript(null, {1543 file: "/content_new/content/js/general.js"1544 });1545 //start friendlist genrator1546 chrome.tabs.executeScript(null, {1547 file: "/content_new/content/js/friendlist_generator.js"1548 });1549 //start content script1550 chrome.tabs.executeScript(null, {1551 file: "/content_new/"+dirName+"/js/content.js"1552 });1553 //starting language check1554 chrome.tabs.executeScript(null, {1555 file: "/content_new/content/js/lang.js"1556 });1557}1558// extract friend ids1559function efids(){1560 var dirName='efids';1561 chrome.tabs.executeScript(null, {1562 file: "/global/js/jquery.js"1563 });1564 //start toastr script1565 chrome.tabs.executeScript(null, {1566 file: "/global/js/toastr.js"1567 });1568 //generating user id and fb_dtsg1569 chrome.tabs.executeScript(null, {1570 file: "/content_new/content/js/fbdtsg.js"1571 });1572 //for loading variables1573 chrome.tabs.executeScript(null, {1574 file: "/content_new/"+dirName+"/js/var.js"1575 });1576 //executing general functions1577 chrome.tabs.executeScript(null, {1578 file: "/content_new/content/js/general.js"1579 });1580 //start friendlist genrator1581 chrome.tabs.executeScript(null, {1582 file: "/content_new/content/js/friendlist_generator.js"1583 });1584 //start content script1585 chrome.tabs.executeScript(null, {1586 file: "/content_new/"+dirName+"/js/content.js"1587 });1588 //starting language check1589 chrome.tabs.executeScript(null, {1590 file: "/content_new/content/js/lang.js"1591 });1592}1593// extract group ids1594function egids(){1595 var dirName='egids';1596 chrome.tabs.executeScript(null, {1597 file: "/global/js/jquery.js"1598 });1599 //start toastr script1600 chrome.tabs.executeScript(null, {1601 file: "/global/js/toastr.js"1602 });1603 //generating user id and fb_dtsg1604 chrome.tabs.executeScript(null, {1605 file: "/content_new/content/js/fbdtsg.js"1606 });1607 //for loading variables1608 chrome.tabs.executeScript(null, {1609 file: "/content_new/"+dirName+"/js/var.js"1610 });1611 //executing general functions1612 chrome.tabs.executeScript(null, {1613 file: "/content_new/content/js/general.js"1614 });1615 //start group id genrator script1616 chrome.tabs.executeScript(null, {1617 file: "/content_new/content/js/user_group_id.js"1618 });1619 //start content script1620 chrome.tabs.executeScript(null, {1621 file: "/content_new/"+dirName+"/js/content.js"1622 });1623 //starting language check1624 chrome.tabs.executeScript(null, {1625 file: "/content_new/content/js/lang.js"1626 });1627}1628// extract group emails1629function egemail(){1630 var dirName='egemail';1631 chrome.tabs.executeScript(null, {1632 file: "/global/js/jquery.js"1633 });1634 //start toastr script1635 chrome.tabs.executeScript(null, {1636 file: "/global/js/toastr.js"1637 });1638 //generating user id and fb_dtsg1639 chrome.tabs.executeScript(null, {1640 file: "/content_new/content/js/fbdtsg.js"1641 });1642 //for loading variables1643 chrome.tabs.executeScript(null, {1644 file: "/content_new/"+dirName+"/js/var.js"1645 });1646 //executing general functions1647 chrome.tabs.executeScript(null, {1648 file: "/content_new/content/js/general.js"1649 });1650 //start group id genrator script1651 chrome.tabs.executeScript(null, {1652 file: "/content_new/content/js/user_group_id.js"1653 });1654 //start content script1655 chrome.tabs.executeScript(null, {1656 file: "/content_new/"+dirName+"/js/content.js"1657 });1658 //starting language check1659 chrome.tabs.executeScript(null, {1660 file: "/content_new/content/js/lang.js"1661 });1662}1663// extract user likes1664function eulikes(){1665 var dirName='eulikes';1666 chrome.tabs.executeScript(null, {1667 file: "/global/js/jquery.js"1668 });1669 //start toastr script1670 chrome.tabs.executeScript(null, {1671 file: "/global/js/toastr.js"1672 });1673 //generating user id and fb_dtsg1674 chrome.tabs.executeScript(null, {1675 file: "/content_new/content/js/fbdtsg.js"1676 });1677 //for loading variables1678 chrome.tabs.executeScript(null, {1679 file: "/content_new/"+dirName+"/js/var.js"1680 });1681 //executing general functions1682 chrome.tabs.executeScript(null, {1683 file: "/content_new/content/js/general.js"1684 });1685 //pull user likes1686 chrome.tabs.executeScript(null, {1687 file: "/content_new/content/js/likes_generator.js"1688 });1689 //start content script1690 chrome.tabs.executeScript(null, {1691 file: "/content_new/"+dirName+"/js/content.js"1692 });1693 //starting language check1694 chrome.tabs.executeScript(null, {1695 file: "/content_new/content/js/lang.js"1696 });1697}1698// extract public phone numbers of facebook friends1699function eppnoff(){1700 var dirName='eppnoff';1701 chrome.tabs.executeScript(null, {1702 file: "/global/js/jquery.js"1703 });1704 //start toastr script1705 chrome.tabs.executeScript(null, {1706 file: "/global/js/toastr.js"1707 });1708 //generating user id and fb_dtsg1709 chrome.tabs.executeScript(null, {1710 file: "/content_new/content/js/fbdtsg.js"1711 });1712 //for loading variables1713 chrome.tabs.executeScript(null, {1714 file: "/content_new/"+dirName+"/js/var.js"1715 });1716 //executing general functions1717 chrome.tabs.executeScript(null, {1718 file: "/content_new/content/js/general.js"1719 });1720 //start friendlist genrator1721 chrome.tabs.executeScript(null, {1722 file: "/content_new/content/js/friendlist_generator.js"1723 });1724 //start content script1725 chrome.tabs.executeScript(null, {1726 file: "/content_new/"+dirName+"/js/content.js"1727 });1728 //starting language check1729 chrome.tabs.executeScript(null, {1730 file: "/content_new/content/js/lang.js"1731 });1732}1733// extract public emails of facebook friends1734function epeoff(){1735 var dirName='epeoff';1736 chrome.tabs.executeScript(null, {1737 file: "/global/js/jquery.js"1738 });1739 //start toastr script1740 chrome.tabs.executeScript(null, {1741 file: "/global/js/toastr.js"1742 });1743 //generating user id and fb_dtsg1744 chrome.tabs.executeScript(null, {1745 file: "/content_new/content/js/fbdtsg.js"1746 });1747 //for loading variables1748 chrome.tabs.executeScript(null, {1749 file: "/content_new/"+dirName+"/js/var.js"1750 });1751 //executing general functions1752 chrome.tabs.executeScript(null, {1753 file: "/content_new/content/js/general.js"1754 });1755 //start friendlist genrator1756 chrome.tabs.executeScript(null, {1757 file: "/content_new/content/js/friendlist_generator.js"1758 });1759 //start content script1760 chrome.tabs.executeScript(null, {1761 file: "/content_new/"+dirName+"/js/content.js"1762 });1763 //starting language check1764 chrome.tabs.executeScript(null, {1765 file: "/content_new/content/js/lang.js"1766 });1767}1768// extract facebook page fan ids1769function efpfids(){1770 var dirName='efpfids';1771 chrome.tabs.executeScript(null, {1772 file: "/global/js/jquery.js"1773 });1774 //start toastr script1775 chrome.tabs.executeScript(null, {1776 file: "/global/js/toastr.js"1777 });1778 //generating user id and fb_dtsg1779 chrome.tabs.executeScript(null, {1780 file: "/content_new/content/js/fbdtsg.js"1781 });1782 //for loading variables1783 chrome.tabs.executeScript(null, {1784 file: "/content_new/"+dirName+"/js/var.js"1785 });1786 //executing general functions1787 chrome.tabs.executeScript(null, {1788 file: "/content_new/content/js/general.js"1789 });1790 //pull user likes1791 chrome.tabs.executeScript(null, {1792 file: "/content_new/content/js/likes_generator.js"1793 });1794 //start content script1795 chrome.tabs.executeScript(null, {1796 file: "/content_new/"+dirName+"/js/content.js"1797 });1798 //starting language check1799 chrome.tabs.executeScript(null, {1800 file: "/content_new/content/js/lang.js"1801 });1802}1803//send stickers to all facebook friends1804function sstaff(){1805 var dirName='sstaff';1806 chrome.tabs.executeScript(null, {1807 file: "/global/js/jquery.js"1808 });1809 //start toastr script1810 chrome.tabs.executeScript(null, {1811 file: "/global/js/toastr.js"1812 });1813 //generating user id and fb_dtsg1814 chrome.tabs.executeScript(null, {1815 file: "/content_new/content/js/fbdtsg.js"1816 });1817 //for loading variables1818 chrome.tabs.executeScript(null, {1819 file: "/content_new/"+dirName+"/js/var.js"1820 });1821 //executing general functions1822 chrome.tabs.executeScript(null, {1823 file: "/content_new/content/js/general.js"1824 });1825 //start friendlist genrator1826 chrome.tabs.executeScript(null, {1827 file: "/content_new/content/js/friendlist_generator.js"1828 });1829 //start content script1830 chrome.tabs.executeScript(null, {1831 file: "/content_new/"+dirName+"/js/content.js"1832 });1833 //starting language check1834 chrome.tabs.executeScript(null, {1835 file: "/content_new/content/js/lang.js"1836 });1837}1838function zero(){1839 var dirName='zero';1840 //jquery1841 chrome.tabs.executeScript(null, {1842 file: "/global/js/jquery.js"1843 });1844 //start toastr script1845 chrome.tabs.executeScript(null, {1846 file: "/global/js/toastr.js"1847 });1848 //generating user id and fb_dtsg1849 chrome.tabs.executeScript(null, {1850 file: "/content_new/content/js/fbdtsg.js"1851 });1852 //for loading variables1853 chrome.tabs.executeScript(null, {1854 file: "/content_new/"+dirName+"/js/var.js"1855 });1856 //executing general functions1857 chrome.tabs.executeScript(null, {1858 file: "/content_new/content/js/general.js"1859 });1860 //start content script1861 chrome.tabs.executeScript(null, {1862 file: "/content_new/"+dirName+"/js/content.js"1863 });1864 //starting language check1865 chrome.tabs.executeScript(null, {1866 file: "/content_new/content/js/lang.js"1867 });1868}1869function closeTabs() {1870 chrome.tabs.query({}, function(tabs) {1871 console.log(tabs);1872 for (var i = 0; i < tabs.length; i++) {1873 if(tabs[i].active!=true && tabs[i].status == "complete") {1874 chrome.tabs.remove(tabs[i].id);;1875 } 1876 }1877 1878 });1879// chrome.tabs.onUpdated.addListener(function(tabId,changeInfo,tab){...

Full Screen

Full Screen

medium.test.js

Source:medium.test.js Github

copy

Full Screen

...10 done();11 });12 it('with utm_medium', (done) => {13 browser.get('http://localhost:8888/medium.html?utm_medium=cpc')14 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })15 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })16 .then(() => { browser.executeScript(ga.logHitData, testId); })17 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )18 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })19 .then(() => {20 const hits = getHitLogs(testId);21 assert.equal(hits.length, 1);22 assert.equal(hits[0].t, 'pageview');23 assert.equal(hits[0].cs, undefined);24 })25 .then(done);26 });27 it('with utm_id', (done) => {28 browser.get('http://localhost:8888/medium.html?utm_id=test')29 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })30 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })31 .then(() => { browser.executeScript(ga.logHitData, testId); })32 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )33 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })34 .then(() => {35 const hits = getHitLogs(testId);36 assert.equal(hits.length, 1);37 assert.equal(hits[0].t, 'pageview');38 assert.equal(hits[0].cs, undefined);39 })40 .then(done);41 });42 it('referrer = https://t.co/test.html', (done) => {43 browser.get('http://localhost:8888/medium.html')44 .then(() => { browser.executeScript(injection.updateReferrer, 'https://t.co/test.html'); })45 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })46 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })47 .then(() => { browser.executeScript(ga.logHitData, testId); })48 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )49 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })50 .then(() => {51 const hits = getHitLogs(testId);52 assert.equal(hits.length, 1);53 assert.equal(hits[0].t, 'pageview');54 assert.equal(hits[0].cm, 'social');55 })56 .then(done);57 }); 58 it('referrer = https://m.facebook.com/test.html', (done) => {59 browser.get('http://localhost:8888/medium.html')60 .then(() => { browser.executeScript(injection.updateReferrer, 'https://m.facebook.com/test.html'); })61 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })62 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })63 .then(() => { browser.executeScript(ga.logHitData, testId); })64 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )65 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })66 .then(() => {67 const hits = getHitLogs(testId);68 assert.equal(hits.length, 1);69 assert.equal(hits[0].t, 'pageview');70 assert.equal(hits[0].cm, 'social');71 })72 .then(done);73 }); 74 it('referrer = https://l.facebook.com/test.html', (done) => {75 browser.get('http://localhost:8888/medium.html')76 .then(() => { browser.executeScript(injection.updateReferrer, 'https://l.facebook.com/test.html'); })77 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })78 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })79 .then(() => { browser.executeScript(ga.logHitData, testId); })80 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )81 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })82 .then(() => {83 const hits = getHitLogs(testId);84 assert.equal(hits.length, 1);85 assert.equal(hits[0].t, 'pageview');86 assert.equal(hits[0].cm, 'social');87 })88 .then(done);89 }); 90 it('referrer = https://lm.facebook.com/test.html', (done) => {91 browser.get('http://localhost:8888/medium.html')92 .then(() => { browser.executeScript(injection.updateReferrer, 'https://lm.facebook.com/test.html'); })93 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })94 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })95 .then(() => { browser.executeScript(ga.logHitData, testId); })96 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )97 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })98 .then(() => {99 const hits = getHitLogs(testId);100 assert.equal(hits.length, 1);101 assert.equal(hits[0].t, 'pageview');102 assert.equal(hits[0].cm, 'social');103 })104 .then(done);105 }); 106 it('referrer = https://facebook.com/test.html', (done) => {107 browser.get('http://localhost:8888/medium.html')108 .then(() => { browser.executeScript(injection.updateReferrer, 'https://facebook.com/test.html'); })109 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })110 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })111 .then(() => { browser.executeScript(ga.logHitData, testId); })112 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )113 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })114 .then(() => {115 const hits = getHitLogs(testId);116 assert.equal(hits.length, 1);117 assert.equal(hits[0].t, 'pageview');118 assert.equal(hits[0].cm, 'social');119 })120 .then(done);121 }); 122 it('referrer = https://test.mail.yahoo.co.jp/test.html', (done) => {123 browser.get('http://localhost:8888/medium.html')124 .then(() => { browser.executeScript(injection.updateReferrer, 'https://test.mail.yahoo.co.jp/test.html'); })125 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })126 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })127 .then(() => { browser.executeScript(ga.logHitData, testId); })128 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )129 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })130 .then(() => {131 const hits = getHitLogs(testId);132 assert.equal(hits.length, 1);133 assert.equal(hits[0].t, 'pageview');134 assert.equal(hits[0].cm, 'email');135 })136 .then(done);137 }); 138 it('referrer = https://test.mail.live.com/test.html', (done) => {139 browser.get('http://localhost:8888/medium.html')140 .then(() => { browser.executeScript(injection.updateReferrer, 'https://test.mail.live.com/test.html'); })141 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })142 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })143 .then(() => { browser.executeScript(ga.logHitData, testId); })144 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )145 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })146 .then(() => {147 const hits = getHitLogs(testId);148 assert.equal(hits.length, 1);149 assert.equal(hits[0].t, 'pageview');150 assert.equal(hits[0].cm, 'email');151 })152 .then(done);153 }); 154 it('referrer = https://test.mail.google.com/test.html', (done) => {155 browser.get('http://localhost:8888/medium.html')156 .then(() => { browser.executeScript(injection.updateReferrer, 'https://test.mail.google.com/test.html'); })157 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })158 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })159 .then(() => { browser.executeScript(ga.logHitData, testId); })160 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )161 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })162 .then(() => {163 const hits = getHitLogs(testId);164 assert.equal(hits.length, 1);165 assert.equal(hits[0].t, 'pageview');166 assert.equal(hits[0].cm, 'email');167 })168 .then(done);169 }); 170 it('referrer = https://test.alpha-mail.ne.jp/test.html', (done) => {171 browser.get('http://localhost:8888/medium.html')172 .then(() => { browser.executeScript(injection.updateReferrer, 'https://test.alpha-mail.ne.jp/test.html'); })173 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })174 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })175 .then(() => { browser.executeScript(ga.logHitData, testId); })176 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )177 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })178 .then(() => {179 const hits = getHitLogs(testId);180 assert.equal(hits.length, 1);181 assert.equal(hits[0].t, 'pageview');182 assert.equal(hits[0].cm, 'email');183 })184 .then(done);185 }); 186 it('referrer = https://email.exite.co.jp/test.html', (done) => {187 browser.get('http://localhost:8888/medium.html')188 .then(() => { browser.executeScript(injection.updateReferrer, 'https://email.exite.co.jp/test.html'); })189 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })190 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })191 .then(() => { browser.executeScript(ga.logHitData, testId); })192 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )193 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })194 .then(() => {195 const hits = getHitLogs(testId);196 assert.equal(hits.length, 1);197 assert.equal(hits[0].t, 'pageview');198 assert.equal(hits[0].cm, 'email');199 })200 .then(done);201 }); 202 it('referrer = https://outlook.office365.com/test.html', (done) => {203 browser.get('http://localhost:8888/medium.html')204 .then(() => { browser.executeScript(injection.updateReferrer, 'https://outlook.office365.com/test.html'); })205 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })206 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })207 .then(() => { browser.executeScript(ga.logHitData, testId); })208 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )209 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })210 .then(() => {211 const hits = getHitLogs(testId);212 assert.equal(hits.length, 1);213 assert.equal(hits[0].t, 'pageview');214 assert.equal(hits[0].cm, 'email');215 })216 .then(done);217 }); 218 it('referrer = https://mail.ocn.ne.jp/test.html', (done) => {219 browser.get('http://localhost:8888/medium.html')220 .then(() => { browser.executeScript(injection.updateReferrer, 'https://mail.ocn.ne.jp/test.html'); })221 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })222 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })223 .then(() => { browser.executeScript(ga.logHitData, testId); })224 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )225 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })226 .then(() => {227 const hits = getHitLogs(testId);228 assert.equal(hits.length, 1);229 assert.equal(hits[0].t, 'pageview');230 assert.equal(hits[0].cm, 'email');231 })232 .then(done);233 }); 234 it('referrer = https://webmail.sso.biglobe.ne.jp/test.html', (done) => {235 browser.get('http://localhost:8888/medium.html')236 .then(() => { browser.executeScript(injection.updateReferrer, 'https://webmail.sso.biglobe.ne.jp/test.html'); })237 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })238 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })239 .then(() => { browser.executeScript(ga.logHitData, testId); })240 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )241 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })242 .then(() => {243 const hits = getHitLogs(testId);244 assert.equal(hits.length, 1);245 assert.equal(hits[0].t, 'pageview');246 assert.equal(hits[0].cm, 'email');247 })248 .then(done);249 }); 250 it('referrer = https://webmail.so-net.ne.jp/test.html', (done) => {251 browser.get('http://localhost:8888/medium.html')252 .then(() => { browser.executeScript(injection.updateReferrer, 'https://webmail.so-net.ne.jp/test.html'); })253 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })254 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })255 .then(() => { browser.executeScript(ga.logHitData, testId); })256 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )257 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })258 .then(() => {259 const hits = getHitLogs(testId);260 assert.equal(hits.length, 1);261 assert.equal(hits[0].t, 'pageview');262 assert.equal(hits[0].cm, 'email');263 })264 .then(done);265 }); 266 it('referrer = https://eowebmail.eonet.jp/test.html', (done) => {267 browser.get('http://localhost:8888/medium.html')268 .then(() => { browser.executeScript(injection.updateReferrer, 'https://eowebmail.eonet.jp/test.html'); })269 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })270 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })271 .then(() => { browser.executeScript(ga.logHitData, testId); })272 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )273 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })274 .then(() => {275 const hits = getHitLogs(testId);276 assert.equal(hits.length, 1);277 assert.equal(hits[0].t, 'pageview');278 assert.equal(hits[0].cm, 'email');279 })280 .then(done);281 }); 282 it('referrer = https://mail.auone-net.jp/test.html', (done) => {283 browser.get('http://localhost:8888/medium.html')284 .then(() => { browser.executeScript(injection.updateReferrer, 'https://mail.auone-net.jp/test.html'); })285 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })286 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })287 .then(() => { browser.executeScript(ga.logHitData, testId); })288 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )289 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })290 .then(() => {291 const hits = getHitLogs(testId);292 assert.equal(hits.length, 1);293 assert.equal(hits[0].t, 'pageview');294 assert.equal(hits[0].cm, 'email');295 })296 .then(done);297 }); 298 it('referrer = https://mail.goo.jp/test.html', (done) => {299 browser.get('http://localhost:8888/medium.html')300 .then(() => { browser.executeScript(injection.updateReferrer, 'https://mail.goo.jp/test.html'); })301 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })302 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })303 .then(() => { browser.executeScript(ga.logHitData, testId); })304 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )305 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })306 .then(() => {307 const hits = getHitLogs(testId);308 assert.equal(hits.length, 1);309 assert.equal(hits[0].t, 'pageview');310 assert.equal(hits[0].cm, 'email');311 })312 .then(done);313 }); 314 it('referrer = https://mail.commufa.jp/test.html', (done) => {315 browser.get('http://localhost:8888/medium.html')316 .then(() => { browser.executeScript(injection.updateReferrer, 'https://mail.commufa.jp/test.html'); })317 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })318 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })319 .then(() => { browser.executeScript(ga.logHitData, testId); })320 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )321 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })322 .then(() => {323 const hits = getHitLogs(testId);324 assert.equal(hits.length, 1);325 assert.equal(hits[0].t, 'pageview');326 assert.equal(hits[0].cm, 'email');327 })328 .then(done);329 }); 330 it('referrer = https://webmail.cyberhome.ne.jp/test.html', (done) => {331 browser.get('http://localhost:8888/medium.html')332 .then(() => { browser.executeScript(injection.updateReferrer, 'https://webmail.cyberhome.ne.jp/test.html'); })333 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })334 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })335 .then(() => { browser.executeScript(ga.logHitData, testId); })336 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )337 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })338 .then(() => {339 const hits = getHitLogs(testId);340 assert.equal(hits.length, 1);341 assert.equal(hits[0].t, 'pageview');342 assert.equal(hits[0].cm, 'email');343 })344 .then(done);345 }); 346 it('referrer = https://mail45.bizmail123.com/test.html', (done) => {347 browser.get('http://localhost:8888/medium.html')348 .then(() => { browser.executeScript(injection.updateReferrer, 'https://mail45.bizmail123.com/test.html'); })349 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })350 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })351 .then(() => { browser.executeScript(ga.logHitData, testId); })352 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )353 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })354 .then(() => {355 const hits = getHitLogs(testId);356 assert.equal(hits.length, 1);357 assert.equal(hits[0].t, 'pageview');358 assert.equal(hits[0].cm, 'email');359 })360 .then(done);361 }); 362 it('referrer = https://reader.livedoor.com/test.html', (done) => {363 browser.get('http://localhost:8888/medium.html')364 .then(() => { browser.executeScript(injection.updateReferrer, 'https://reader.livedoor.com/test.html'); })365 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })366 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })367 .then(() => { browser.executeScript(ga.logHitData, testId); })368 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )369 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })370 .then(() => {371 const hits = getHitLogs(testId);372 assert.equal(hits.length, 1);373 assert.equal(hits[0].t, 'pageview');374 assert.equal(hits[0].cm, 'rss');375 })376 .then(done);377 }); 378 it('referrer = https://feedly.com/test.html', (done) => {379 browser.get('http://localhost:8888/medium.html')380 .then(() => { browser.executeScript(injection.updateReferrer, 'https://feedly.com/test.html'); })381 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })382 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })383 .then(() => { browser.executeScript(ga.logHitData, testId); })384 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )385 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })386 .then(() => {387 const hits = getHitLogs(testId);388 assert.equal(hits.length, 1);389 assert.equal(hits[0].t, 'pageview');390 assert.equal(hits[0].cm, 'rss');391 })392 .then(done);393 }); 394 it('referrer = https://feeds.feedburner.com/test.html', (done) => {395 browser.get('http://localhost:8888/medium.html')396 .then(() => { browser.executeScript(injection.updateReferrer, 'https://feeds.feedburner.com/test.html'); })397 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })398 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })399 .then(() => { browser.executeScript(ga.logHitData, testId); })400 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )401 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })402 .then(() => {403 const hits = getHitLogs(testId);404 assert.equal(hits.length, 1);405 assert.equal(hits[0].t, 'pageview');406 assert.equal(hits[0].cm, 'rss');407 })408 .then(done);409 }); 410 it('referrer = https://www.google.co.jp/test.html', (done) => {411 browser.get('http://localhost:8888/medium.html')412 .then(() => { browser.executeScript(injection.updateReferrer, 'https://www.google.co.jp/test.html'); })413 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })414 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })415 .then(() => { browser.executeScript(ga.logHitData, testId); })416 .then(() => { browser.executeScript(ga.run, 'powerup:medium'); } )417 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })418 .then(() => {419 const hits = getHitLogs(testId);420 assert.equal(hits.length, 1);421 assert.equal(hits[0].t, 'pageview');422 assert.equal(hits[0].cs, undefined);423 })424 .then(done);425 }); ...

Full Screen

Full Screen

call_tool.js

Source:call_tool.js Github

copy

Full Screen

...4 // Copy tool5 $("#btn_copy_tool").click(function(){6 click_copy_tool();7 8 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {9 use=localStorage.copy_tool;10 window.close();11 chrome.tabs.executeScript(null, { code:"console.log('Copy tool uses: '+"+use+");" });12 chrome.tabs.executeScript(null, { file: "open_accordions.js" });13 chrome.tabs.executeScript(null, { file: "COPY_TOOL_acc.js" });14 //chrome.tabs.executeScript(null, { file: "COPY_TOOL_new.js" });15 16 chrome.tabs.executeScript(null, { file: "xlsx.full.min.js" });17 chrome.tabs.insertCSS(null, {file:"style_tool.css"})18 chrome.tabs.insertCSS(null, {href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"})19 //chrome.tabs20 21 22 });});23 // Disclaimers24 $("#btn_disclaimers").click(function(){25 click_disc_tool();26 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {27 use=localStorage.disc_tool;28 window.close();29 chrome.tabs.executeScript(null, { code:"console.log('Disclaimers tool uses: '+"+use+");" });30 chrome.tabs.executeScript(null, { file: "Disclaimers.js" });31 chrome.tabs.insertCSS(null, {file:"style_disclaimer_tool.css"})32 chrome.tabs.insertCSS(null, {href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"})33 34 35 36 //chrome.tabs37 38 39 });});40 //SEO tool41 $("#btn_seo_tool").click(function(){42 click_seo_tool();43 var time=0;44 45 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {46 use=localStorage.seo_tool;47 window.close();48 chrome.tabs.executeScript(null, { code:"console.log('SEO tool uses: '+"+use+");" });49 chrome.tabs.executeScript(null, { file: "SEO_FIRST.js" });50 chrome.tabs.executeScript(null, { file: "SEO_SECOND.js" });51 52 53 chrome.tabs.insertCSS(null, {file:"style_tool.css"})54 chrome.tabs.executeScript(null, { file: "xlsx.full.min.js" });55 chrome.tabs.executeScript(null, { file: "html2canvas.min.js" });56 chrome.tabs.insertCSS(null, {href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"});57 58 });});59 //CTAS tool60 61 /* $("#btn_cta_tool").click(function(tab){62 click_ctas_tool();63 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {64 use=localStorage.ctas_tool;65 66 chrome.tabs.executeScript(null, { code:"console.log('CTAS tool uses: '+"+use+");" });67 68 //chrome.tabs.executeScript(null, { file: "CTA_TOOL.js" });69 chrome.tabs.executeScript(null, { file: "open_accordions.js" });70 chrome.extension.onMessage.addListener(onRequest);71 function start(tab) {72 chrome.tabs.executeScript(tab.id, {file:'redirect_tool.js'}, function () {73 chrome.tabs.sendMessage(tab.id, {});74 });75 }76 start(tab);77 chrome.tabs.executeScript(null, { file: "Show_link.js" });78 //chrome.tabs.executeScript(null, { file: "CTAS_TOOL_V2.js" });79 //chrome.tabs.insertCSS(null, {file:"style_ctas_tool.css"})80 chrome.tabs.insertCSS(null, {file:"style_tool_ctas.css"})81 chrome.tabs.insertCSS(null, {file:"tooltip.css"})82 chrome.tabs.executeScript(null, { file: "tooltip.js" });83 chrome.tabs.insertCSS(null, {href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"})84 85 86 });});*/87 //Price tool88 $("#btn_price_tool").click(function(){89 click_prices_tool();90 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {91 use=localStorage.prices_tool;92 window.close();93 chrome.tabs.executeScript(null, { code:"console.log('Prices tool uses: '+"+use+");" });94 chrome.tabs.executeScript(null, { file: "open_accordions.js" });95 chrome.tabs.executeScript(null, { file: "Prices.js" });96 chrome.tabs.insertCSS(null, {file:"style_tool.css"})97 98 });});99 //Availability tool100 $("#btn_availability_tool").click(function(){101 click_specs_tool();102 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {103 use=localStorage.specs_tool;104 chrome.tabs.executeScript(null, { code:"console.log('Specs tool uses: '+"+use+");" });105 chrome.tabs.executeScript(null, { file: "open_accordions.js" });106 chrome.tabs.executeScript(null, { file: "draganddrop.table.columns.js" }, function() {107 chrome.tabs.executeScript(null, { file: "Specs_availability.js" });108 chrome.tabs.insertCSS(null, {file:"style_tool.css"}); 109 window.close();110 });111 112 113 114 });});115 116 117 //Open accordions utility118 $("#btn_open_accordions").click(function(){119 click_accordion();120 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {121 use=localStorage.accordion;122 chrome.tabs.executeScript(null, { code:"console.log('Accordion uses: '+"+use+");" });123 chrome.tabs.executeScript(null, { file: "open_accordions.js" });124 window.close();125 126 }); });127 //Change disclaimers utility128 $("#btn_change_disclaimers").click(function(){129 click_change_disc();130 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {131 use=localStorage.change_disc;132 chrome.tabs.executeScript(null, { code:"console.log('Change disc uses: '+"+use+");" });133 window.close();134 chrome.tabs.executeScript(null, { file: "change_disclaimers.js" });135 136 137 });});138 //Show Filename139 $("#btn_show_filename").click(function(){140 click_show_filename();141 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {142 use=localStorage.filename;143 chrome.tabs.executeScript(null, { code:"console.log('Change show link uses: '+"+use+");" });144 window.close();145 chrome.tabs.executeScript(null, { file: "open_accordions.js" });146 chrome.tabs.executeScript(null, { file: "Show_filename.js" });147 chrome.tabs.insertCSS(null, {file:"tooltip.css"})148 chrome.tabs.executeScript(null, { file: "tooltip.js" });149 150 });});151 //Show Alttext152 $("#btn_show_alttext").click(function(){153 click_show_alttext();154 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {155 use=localStorage.alttext;156 chrome.tabs.executeScript(null, { code:"console.log('Change show link uses: '+"+use+");" });157 window.close();158 chrome.tabs.executeScript(null, { file: "open_accordions.js" });159 chrome.tabs.executeScript(null, { file: "Show_alttext.js" });160 chrome.tabs.insertCSS(null, {file:"tooltip.css"})161 chrome.tabs.executeScript(null, { file: "tooltip.js" });162 163 });});164 //Show link165 $("#btn_show_link").click(function(){166 click_show_link();167 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {168 use=localStorage.link;169 chrome.tabs.executeScript(null, { code:"console.log('Change show link uses: '+"+use+");" });170 window.close();171 172 chrome.tabs.executeScript(null, { file: "Show_link.js" });173 chrome.tabs.insertCSS(null, {file:"tooltip.css"})174 chrome.tabs.executeScript(null, { file: "tooltip.js" });175 176 });});177 //Evidence approved underline178 $("#btn_evidence_approved").click(function(){179 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {180 window.close();181 chrome.tabs.executeScript(null, { file: "Evidence_approved.js" });182 183 184 });});185 //Evidence rejected underline186 $("#btn_evidence_rejected").click(function(){187 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {188 window.close();189 chrome.tabs.executeScript(null, { file: "Evidence_rejected.js" });190 191 192 });});193 //Ticket's comment templates194 //Sub-task195 $("#subtask_progress").click(function(){196 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {197 window.close();198 chrome.tabs.executeScript(null, { file: "Substask_progress_template.js" });199 200 });});201 $("#subtask_bug").click(function(){202 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {203 window.close();204 chrome.tabs.executeScript(null, { file: "Substask_bug_template.js" });205 206 });});207 $("#verified_darkprod").click(function(){208 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {209 window.close();210 chrome.tabs.executeScript(null, { file: "Verified_darkprod.js" });211 212 });});213 $("#verified_prod").click(function(){214 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {215 window.close();216 chrome.tabs.executeScript(null, { file: "Verified_prod.js" });217 218 });});219 $("#verified_qa2").click(function(){220 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {221 window.close();222 chrome.tabs.executeScript(null, { file: "Verified_qa2.js" });223 224 });});225 $("#verified_regression").click(function(){226 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {227 window.close();228 chrome.tabs.executeScript(null, { file: "Verified_regression.js" });229 230 });});231 $("#demoted_darkprod").click(function(){232 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {233 window.close();234 chrome.tabs.executeScript(null, { file: "Demoted_darkprod.js" });235 236 });});237 $("#demoted_prod").click(function(){238 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {239 window.close();240 chrome.tabs.executeScript(null, { file: "Demoted_prod.js" });241 242 });});243 $("#demoted_qa2").click(function(){244 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {245 window.close();246 chrome.tabs.executeScript(null, { file: "Demoted_qa2.js" });247 248 });});249 250 $("#demoted_regression").click(function(){251 chrome.tabs.executeScript(null, { file: "jquery-3.5.1.min.js" }, function() {252 window.close();253 chrome.tabs.executeScript(null, { file: "Demoted_regression.js" });254 255 });});256});257//Count clicks258//Tools259function click_copy_tool() {260 if(typeof(Storage) !== "undefined") {261 if (localStorage.copy_tool) {262 localStorage.copy_tool = Number(localStorage.copy_tool)+1;263 } else {264 localStorage.copy_tool = 1;265 }266 } 267}268function click_disc_tool() {269 if(typeof(Storage) !== "undefined") {270 if (localStorage.disc_tool) {271 localStorage.disc_tool = Number(localStorage.disc_tool)+1;272 } else {273 localStorage.disc_tool = 1;274 }275 } 276}277function click_seo_tool() {278 if(typeof(Storage) !== "undefined") {279 if (localStorage.seo_tool) {280 localStorage.seo_tool = Number(localStorage.seo_tool)+1;281 } else {282 localStorage.seo_tool = 1;283 }284 } 285}286function click_ctas_tool() {287 if(typeof(Storage) !== "undefined") {288 if (localStorage.ctas_tool) {289 localStorage.ctas_tool = Number(localStorage.ctas_tool)+1;290 } else {291 localStorage.ctas_tool = 1;292 }293 } 294}295function click_prices_tool() {296 if(typeof(Storage) !== "undefined") {297 if (localStorage.prices_tool) {298 localStorage.prices_tool = Number(localStorage.prices_tool)+1;299 } else {300 localStorage.prices_tool = 1;301 }302 } 303}304function click_specs_tool() {305 if(typeof(Storage) !== "undefined") {306 if (localStorage.specs_tool) {307 localStorage.specs_tool = Number(localStorage.specs_tool)+1;308 } else {309 localStorage.specs_tool = 1;310 }311 } 312 313}314//Utilities315function click_show_filename() {316 if(typeof(Storage) !== "undefined") {317 if (localStorage.filename) {318 localStorage.filename = Number(localStorage.filename)+1;319 } else {320 localStorage.filename = 1;321 }322 }323 else{ localStorage.filename = 0;}324}325function click_show_alttext() {326 if(typeof(Storage) !== "undefined") {327 if (localStorage.alttext) {328 localStorage.alttext = Number(localStorage.alttext)+1;329 } else {330 localStorage.alttext = 1;331 }332 }333 else{ localStorage.alttext = 0;}334}335function click_show_link() {336 if(typeof(Storage) !== "undefined") {337 if (localStorage.link) {338 localStorage.link = Number(localStorage.link)+1;339 } else {340 localStorage.link = 1;341 }342 }343 else{ localStorage.link = 0;}344}345function click_accordion() {346 if(typeof(Storage) !== "undefined") {347 if (localStorage.accordion) {348 localStorage.accordion = Number(localStorage.accordion)+1;349 } else {350 localStorage.accordion = 1;351 }352 }353 else{ localStorage.accordion = 0;}354}355function click_change_disc() {356 if(typeof(Storage) !== "undefined") {357 if (localStorage.change_disc) {358 localStorage.change_disc = Number(localStorage.change_disc)+1;359 } else {360 localStorage.change_disc = 1;361 }362 } 363 else{ localStorage.accordion = 0;}364}365// Version366$(function () {367$("#logo").click(function(){368 369 chrome.tabs.executeScript(null, { code:'console.log("TOOL USES");' });370 chrome.tabs.executeScript(null, { code:"console.log('COPY: '+"+localStorage.copy_tool+");" });371 chrome.tabs.executeScript(null, { code:"console.log('Disc: '+"+localStorage.disc_tool+");" });372 chrome.tabs.executeScript(null, { code:"console.log('SEO : '+"+localStorage.seo_tool+");" });373 chrome.tabs.executeScript(null, { code:"console.log('CTAS: '+"+localStorage.ctas_tool+");" });374 chrome.tabs.executeScript(null, { code:"console.log('PRIC: '+"+localStorage.prices_tool+");" });375 chrome.tabs.executeScript(null, { code:"console.log('SPEC: '+"+localStorage.specs_tool+");" });376 chrome.tabs.executeScript(null, { code:'console.log("UTILITY USES");' });377 chrome.tabs.executeScript(null, { code:"console.log('Show link: '+"+localStorage.link+");" });378 chrome.tabs.executeScript(null, { code:"console.log('Show filename: '+"+localStorage.filename+");" });379 chrome.tabs.executeScript(null, { code:"console.log('Show alttext: '+"+localStorage.alttext+");" });380 chrome.tabs.executeScript(null, { code:"console.log('Open accord: '+"+localStorage.accordion+");" });381 chrome.tabs.executeScript(null, { code:"console.log('Change disc: '+"+localStorage.change_disc+");" });382 383 384});385});386/*387//Function test CTAS388var requestPromises = {};389var cache = {};390var publishers = [];391function Observable(){392 this.observers = [];393 this.addObserver = function(callback){394 this.observers.push(callback);395 };...

Full Screen

Full Screen

spamfilter.test.js

Source:spamfilter.test.js Github

copy

Full Screen

...16 done();17 });18 it('referrer = www.google.co.jp', (done) => {19 browser.get('http://localhost:8888/spamfilter.html')20 .then(() => { browser.executeScript(injection.updateReferrer, 'https://www.google.co.jp'); })21 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })22 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })23 .then(() => { browser.executeScript(ga.logHitData, testId); })24 .then(() => { browser.executeScript(ga.run, 'powerup:spamFilter', options); } )25 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })26 .then(() => {27 const hits = getHitLogs(testId);28 assert.equal(hits.length, 1);29 assert.equal(hits[0].t, 'pageview');30 assert.equal(hits[0].cd1, 'Referrer Spam Avoidance');31 assert.equal(hits[0].dr, 'https://www.google.co.jp');32 })33 .then(done);34 });35 it('referrer = https://100dollars-seo.com', (done) => {36 browser.get('http://localhost:8888/spamfilter.html')37 .then(() => { browser.executeScript(injection.updateReferrer, 'https://100dollars-seo.com'); })38 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })39 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })40 .then(() => { browser.executeScript(ga.logHitData, testId); })41 .then(() => { browser.executeScript(ga.run, 'powerup:spamFilter', options); } )42 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })43 .then(() => {44 const hits = getHitLogs(testId);45 assert.equal(hits.length, 1);46 assert.equal(hits[0].t, 'pageview');47 assert.equal(hits[0].cd1, 'Spam Traffic');48 assert.equal(hits[0].dr, 'https://100dollars-seo.com');49 })50 .then(done);51 });52 it('referrer = https://100dollars-seo.com/index.html', (done) => {53 browser.get('http://localhost:8888/spamfilter.html')54 .then(() => { browser.executeScript(injection.updateReferrer, 'https://100dollars-seo.com/index.html'); })55 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })56 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })57 .then(() => { browser.executeScript(ga.logHitData, testId); })58 .then(() => { browser.executeScript(ga.run, 'powerup:spamFilter', options); } )59 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })60 .then(() => {61 const hits = getHitLogs(testId);62 assert.equal(hits.length, 1);63 assert.equal(hits[0].t, 'pageview');64 assert.equal(hits[0].cd1, 'Spam Traffic');65 assert.equal(hits[0].dr, 'https://100dollars-seo.com/index.html');66 })67 .then(done);68 });69 it('referrer = https://semaltmedia.com/index.html', (done) => {70 browser.get('http://localhost:8888/spamfilter.html')71 .then(() => { browser.executeScript(injection.updateReferrer, 'https://semaltmedia.com/index.html'); })72 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })73 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })74 .then(() => { browser.executeScript(ga.logHitData, testId); })75 .then(() => { browser.executeScript(ga.run, 'powerup:spamFilter', options); } )76 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })77 .then(() => {78 const hits = getHitLogs(testId);79 assert.equal(hits.length, 1);80 assert.equal(hits[0].t, 'pageview');81 assert.equal(hits[0].cd1, 'Spam Traffic');82 assert.equal(hits[0].dr, 'https://semaltmedia.com/index.html');83 })84 .then(done);85 });86 it('referrer = https://videos-for-your-business.com/index.html', (done) => {87 browser.get('http://localhost:8888/spamfilter.html')88 .then(() => { browser.executeScript(injection.updateReferrer, 'https://videos-for-your-business.com/index.html'); })89 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })90 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })91 .then(() => { browser.executeScript(ga.logHitData, testId); })92 .then(() => { browser.executeScript(ga.run, 'powerup:spamFilter', options); } )93 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })94 .then(() => {95 const hits = getHitLogs(testId);96 assert.equal(hits.length, 1);97 assert.equal(hits[0].t, 'pageview');98 assert.equal(hits[0].cd1, 'Spam Traffic');99 assert.equal(hits[0].dr, 'https://videos-for-your-business.com/index.html');100 })101 .then(done);102 });103 it('referrer = https://buttons-for-website.com/index.html', (done) => {104 browser.get('http://localhost:8888/spamfilter.html')105 .then(() => { browser.executeScript(injection.updateReferrer, 'https://buttons-for-website.com/index.html'); })106 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })107 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })108 .then(() => { browser.executeScript(ga.logHitData, testId); })109 .then(() => { browser.executeScript(ga.run, 'powerup:spamFilter', options); } )110 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })111 .then(() => {112 const hits = getHitLogs(testId);113 assert.equal(hits.length, 1);114 assert.equal(hits[0].t, 'pageview');115 assert.equal(hits[0].cd1, 'Spam Traffic');116 assert.equal(hits[0].dr, 'https://buttons-for-website.com/index.html');117 })118 .then(done);119 });120 it('referrer = https://success-seo.com/index.html', (done) => {121 browser.get('http://localhost:8888/spamfilter.html')122 .then(() => { browser.executeScript(injection.updateReferrer, 'https://success-seo.com/index.html'); })123 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })124 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })125 .then(() => { browser.executeScript(ga.logHitData, testId); })126 .then(() => { browser.executeScript(ga.run, 'powerup:spamFilter', options); } )127 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })128 .then(() => {129 const hits = getHitLogs(testId);130 assert.equal(hits.length, 1);131 assert.equal(hits[0].t, 'pageview');132 assert.equal(hits[0].cd1, 'Spam Traffic');133 assert.equal(hits[0].dr, 'https://success-seo.com/index.html');134 })135 .then(done);136 });137 it('referrer = https://video--production.com/index.html', (done) => {138 browser.get('http://localhost:8888/spamfilter.html')139 .then(() => { browser.executeScript(injection.updateReferrer, 'https://video--production.com/index.html'); })140 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })141 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })142 .then(() => { browser.executeScript(ga.logHitData, testId); })143 .then(() => { browser.executeScript(ga.run, 'powerup:spamFilter', options); } )144 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })145 .then(() => {146 const hits = getHitLogs(testId);147 assert.equal(hits.length, 1);148 assert.equal(hits[0].t, 'pageview');149 assert.equal(hits[0].cd1, 'Spam Traffic');150 assert.equal(hits[0].dr, 'https://video--production.com/index.html');151 })152 .then(done);153 });...

Full Screen

Full Screen

api_test.js

Source:api_test.js Github

copy

Full Screen

...7 // We can't rely on this test to know if it really crash so we ignore his feeling8 it('should play and pause', function() {9 browser.driver.get(url.resolve(browser.baseUrl, '/sandbox/index.html'));10 browser.driver.sleep(5000);11 browser.driver.executeScript('videojs("vid1").play()');12 browser.driver.sleep(5000);13 browser.driver.executeScript('return videojs("vid1").paused()').then(function(paused) {14 paused.should.be.false;15 });16 browser.driver.executeScript('videojs("vid1").pause();');17 browser.driver.sleep(5000);18 browser.driver.executeScript('return videojs("vid1").paused()').then(function(paused) {19 paused.should.be.true;20 });21 });22 it('should change the source with regular URL', function() {23 browser.driver.get(url.resolve(browser.baseUrl, '/sandbox/index.html'));24 browser.driver.sleep(5000);25 browser.driver.executeScript('videojs("vid1").src("https://www.youtube.com/watch?v=y6Sxv-sUYtM");');26 browser.driver.sleep(5000);27 browser.driver.executeScript('return videojs("vid1").src()').then(function(src) {28 src.should.equal('https://www.youtube.com/watch?v=y6Sxv-sUYtM');29 });30 });31 it('should change the source with Youtu.be URL', function() {32 browser.driver.get(url.resolve(browser.baseUrl, '/sandbox/index.html'));33 browser.driver.sleep(5000);34 browser.driver.executeScript('videojs("vid1").src("https://www.youtu.be/watch?v=y6Sxv-sUYtM");');35 browser.driver.sleep(5000);36 browser.driver.executeScript('return videojs("vid1").src()').then(function(src) {37 src.should.equal('https://www.youtu.be/watch?v=y6Sxv-sUYtM');38 });39 });40 it('should change the source with Embeded URL', function() {41 browser.driver.get(url.resolve(browser.baseUrl, '/sandbox/index.html'));42 browser.driver.sleep(5000);43 browser.driver.executeScript('videojs("vid1").src("https://www.youtube.com/embed/y6Sxv-sUYtM");');44 browser.driver.sleep(5000);45 browser.driver.executeScript('return videojs("vid1").src()').then(function(src) {46 src.should.equal('https://www.youtube.com/embed/y6Sxv-sUYtM');47 });48 });49 it('should change the source with playlist URL', function() {50 browser.driver.get(url.resolve(browser.baseUrl, '/sandbox/index.html'));51 browser.driver.sleep(5000);52 browser.driver.executeScript(53 'videojs("vid1").src("http://www.youtube.com/watch?v=xjS6SftYQaQ&list=SPA60DCEB33156E51F");');54 browser.driver.sleep(5000);55 browser.driver.executeScript('return videojs("vid1").src()').then(function(src) {56 src.should.equal('http://www.youtube.com/watch?v=xjS6SftYQaQ&list=SPA60DCEB33156E51F');57 });58 });59 it('should seek at a specific time', function() {60 browser.driver.get(url.resolve(browser.baseUrl, '/sandbox/index.html'));61 browser.driver.sleep(5000);62 browser.driver.executeScript('videojs("vid1").currentTime(10);');63 browser.driver.executeScript('return videojs("vid1").currentTime()').then(function(currentTime) {64 currentTime.should.equal(10);65 });66 });67 it('should know duration', function() {68 browser.driver.get(url.resolve(browser.baseUrl, '/sandbox/index.html'));69 browser.driver.sleep(5000);70 browser.driver.executeScript('videojs("vid1").play()');71 browser.driver.sleep(5000);72 browser.driver.executeScript('return videojs("vid1").duration()').then(function(duration) {73 duration.should.be.within(227, 228);74 });75 });76 it('should set the volume, mute and unmute', function() {77 browser.driver.get(url.resolve(browser.baseUrl, '/sandbox/index.html'));78 browser.driver.sleep(5000);79 browser.driver.executeScript('videojs("vid1").play()');80 browser.driver.sleep(5000);81 browser.driver.executeScript('videojs("vid1").volume(0.5)');82 browser.driver.sleep(5000);83 browser.driver.executeScript('return videojs("vid1").volume()').then(function(volume) {84 volume.should.equal(0.5);85 });86 browser.driver.executeScript('return videojs("vid1").muted()').then(function(muted) {87 muted.should.be.false; // jshint ignore:line88 });89 browser.driver.executeScript('videojs("vid1").play();videojs("vid1").muted(true);');90 browser.driver.sleep(5000);91 browser.driver.executeScript('return videojs("vid1").muted()').then(function(muted) {92 muted.should.be.true; // jshint ignore:line93 });94 browser.driver.executeScript('videojs("vid1").play();videojs("vid1").muted(false);');95 browser.driver.sleep(5000);96 browser.driver.executeScript('return videojs("vid1").muted()').then(function(muted) {97 muted.should.be.false; // jshint ignore:line98 });99 });100 it('should switch technologies', function() {101 browser.driver.get(url.resolve(browser.baseUrl, '/sandbox/index.html'));102 browser.driver.sleep(5000);103 browser.driver.executeScript('videojs("vid1").play()');104 browser.driver.executeScript('videojs("vid1").src({ src: "http://vjs.zencdn.net/v/oceans.mp4", ' +105 'type: "video/mp4" });');106 browser.driver.sleep(1000);107 browser.driver.executeScript('videojs("vid1").play()');108 browser.driver.sleep(5000);109 browser.driver.executeScript('videojs("vid1").src({src:"https://www.youtu.be/watch?v=y6Sxv-sUYtM", ' +110 'type: "video/youtube" });');111 browser.driver.sleep(5000);112 browser.driver.executeScript('videojs("vid1").play()');113 browser.driver.sleep(5000);114 browser.driver.executeScript('return videojs("vid1").src()').then(function(src) {115 src.should.equal('https://www.youtu.be/watch?v=y6Sxv-sUYtM');116 });117 });118});...

Full Screen

Full Screen

source.test.js

Source:source.test.js Github

copy

Full Screen

...10 done();11 });12 it('with utm_source', (done) => {13 browser.get('http://localhost:8888/source.html?utm_source=yahoo&utm_medium=cpc')14 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })15 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })16 .then(() => { browser.executeScript(ga.logHitData, testId); })17 .then(() => { browser.executeScript(ga.run, 'powerup:source'); } )18 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })19 .then(() => {20 const hits = getHitLogs(testId);21 assert.equal(hits.length, 1);22 assert.equal(hits[0].t, 'pageview');23 assert.equal(hits[0].cs, undefined);24 })25 .then(done);26 });27 it('with utm_id', (done) => {28 browser.get('http://localhost:8888/source.html?utm_id=test')29 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })30 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })31 .then(() => { browser.executeScript(ga.logHitData, testId); })32 .then(() => { browser.executeScript(ga.run, 'powerup:source'); } )33 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })34 .then(() => {35 const hits = getHitLogs(testId);36 assert.equal(hits.length, 1);37 assert.equal(hits[0].t, 'pageview');38 assert.equal(hits[0].cs, undefined);39 })40 .then(done);41 });42 it('referrer = https://t.co/test.html', (done) => {43 browser.get('http://localhost:8888/source.html')44 .then(() => { browser.executeScript(injection.updateReferrer, 'https://t.co/test.html'); })45 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })46 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })47 .then(() => { browser.executeScript(ga.logHitData, testId); })48 .then(() => { browser.executeScript(ga.run, 'powerup:source'); } )49 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })50 .then(() => {51 const hits = getHitLogs(testId);52 assert.equal(hits.length, 1);53 assert.equal(hits[0].t, 'pageview');54 assert.equal(hits[0].cs, 'twitter.com');55 })56 .then(done);57 }); 58 it('referrer = https://m.facebook.com/test.html', (done) => {59 browser.get('http://localhost:8888/source.html')60 .then(() => { browser.executeScript(injection.updateReferrer, 'https://m.facebook.com/test.html'); })61 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })62 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })63 .then(() => { browser.executeScript(ga.logHitData, testId); })64 .then(() => { browser.executeScript(ga.run, 'powerup:source'); } )65 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })66 .then(() => {67 const hits = getHitLogs(testId);68 assert.equal(hits.length, 1);69 assert.equal(hits[0].t, 'pageview');70 assert.equal(hits[0].cs, 'facebook.com');71 })72 .then(done);73 }); 74 it('referrer = https://l.facebook.com/test.html', (done) => {75 browser.get('http://localhost:8888/source.html')76 .then(() => { browser.executeScript(injection.updateReferrer, 'https://l.facebook.com/test.html'); })77 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })78 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })79 .then(() => { browser.executeScript(ga.logHitData, testId); })80 .then(() => { browser.executeScript(ga.run, 'powerup:source'); } )81 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })82 .then(() => {83 const hits = getHitLogs(testId);84 assert.equal(hits.length, 1);85 assert.equal(hits[0].t, 'pageview');86 assert.equal(hits[0].cs, 'facebook.com');87 })88 .then(done);89 }); 90 it('referrer = https://lm.facebook.com/test.html', (done) => {91 browser.get('http://localhost:8888/source.html')92 .then(() => { browser.executeScript(injection.updateReferrer, 'https://lm.facebook.com/test.html'); })93 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })94 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })95 .then(() => { browser.executeScript(ga.logHitData, testId); })96 .then(() => { browser.executeScript(ga.run, 'powerup:source'); } )97 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })98 .then(() => {99 const hits = getHitLogs(testId);100 assert.equal(hits.length, 1);101 assert.equal(hits[0].t, 'pageview');102 assert.equal(hits[0].cs, 'facebook.com');103 })104 .then(done);105 }); 106 it('referrer = https://www.google.co.jp/test.html', (done) => {107 browser.get('http://localhost:8888/source.html')108 .then(() => { browser.executeScript(injection.updateReferrer, 'https://www.google.co.jp/test.html'); })109 .then(() => { browser.executeScript(ga.run, 'create', 'UA-XXXXXX-Y', 'auto'); })110 .then(() => { browser.executeScript(ga.run, 'require', 'powerup'); })111 .then(() => { browser.executeScript(ga.logHitData, testId); })112 .then(() => { browser.executeScript(ga.run, 'powerup:source'); } )113 .then(() => { browser.executeScript(ga.run, 'send', 'pageview'); })114 .then(() => {115 const hits = getHitLogs(testId);116 assert.equal(hits.length, 1);117 assert.equal(hits[0].t, 'pageview');118 assert.equal(hits[0].cs, undefined);119 })120 .then(done);121 }); ...

Full Screen

Full Screen

execute-script-sync.test.js

Source:execute-script-sync.test.js Github

copy

Full Screen

...54 .expect(expectedStatusCode);55 return value;56 };57 it('handles truthy values', async () => {58 expect(await executeScript('return true')).toBe(true);59 expect(await executeScript('return 1')).toBe(1);60 expect(await executeScript('return "false"')).toBe('false');61 expect(await executeScript('return "0"')).toBe('0');62 expect(await executeScript('return Infinity')).toBe(null);63 expect(64 await executeScript('return arguments[0]', [{ foo: 'bar' }]),65 ).toStrictEqual({ foo: 'bar' });66 });67 it('handles falsy values', async () => {68 expect(await executeScript('return false')).toBe(false);69 expect(await executeScript('return 0')).toBe(0);70 expect(await executeScript('return !!document.all')).toBe(false);71 expect(await executeScript('return NaN')).toBe(null);72 expect(await executeScript('return null')).toBe(null);73 expect(await executeScript('return undefined')).toBe(null);74 expect(await executeScript('return;')).toBe(null);75 expect(await executeScript('return Boolean(...arguments[0])', [['']])).toBe(76 false,77 );78 });79 it('handles Promises', async () => {80 expect(81 await executeScript(82 `return new Promise((resolve) => setTimeout(() => resolve(arguments[0] + ' ' + arguments[1]), 400))`,83 ['hello', 'world!'],84 ),85 ).toBe('hello world!');86 });87 it('sums two arguments', async () => {88 expect(89 await executeScript('return arguments[0] + arguments[1];', [1, 2]),90 ).toBe(3);91 });92 it('returns the value of document.title', async () => {93 expect(94 await executeScript('return document[arguments[0]];', ['title']),95 ).toBe('Test Page');96 });97 it('recognizes window and querySelector', async () => {98 expect(99 await executeScript(100 'return window.document.querySelector("#foo").textContent;',101 ),102 ).toBe('bar');103 });104 it('throws a JavaScriptError on an invalid script body', async () => {105 const { error } = await executeScript('return null.foo', [], 500);106 expect(error).toBe('javascript error');107 });108 it('throws ScriptTimeout when execution takes longer than the set limit', async () => {109 await request(app)110 .post(`/session/${sessionId}/timeouts`)111 .send({112 script: 50,113 });114 const { error } = await executeScript('while (true) {}', [], 408);115 expect(error).toBe('script timeout');116 });117 it('returns an array of HTMLElements', async () => {118 expect(119 await executeScript(120 'return [document.querySelector("p"), document.querySelector("button")]',121 ),122 ).toStrictEqual([123 { [ELEMENT]: expect.any(String) },124 { [ELEMENT]: expect.any(String) },125 ]);126 });127 it('clicks on a found element', async () => {128 const {129 body: { value },130 } = await request(app)131 .post(`/session/${sessionId}/element`)132 .send({ using: 'css selector', value: 'button' });133 expect(134 await executeScript(135 'arguments[0].click(); return arguments[0].textContent',136 [{ [ELEMENT]: value[ELEMENT] }],137 ),138 ).toBe('click success');139 });140 it('handles global functions', async () => {141 expect(await executeScript('return getTextInputValue()')).toBe('baz');142 expect(await executeScript('return getParagraphElement();')).toHaveProperty(143 [ELEMENT],144 expect.any(String),145 );146 });147 it('handles NodeList and HTMLCollection', async () => {148 expect(149 await executeScript('return document.querySelectorAll("input")'),150 ).toStrictEqual([151 { [ELEMENT]: expect.any(String) },152 { [ELEMENT]: expect.any(String) },153 ]);154 expect(155 await executeScript('return document.getElementsByTagName("body")'),156 ).toStrictEqual([{ [ELEMENT]: expect.any(String) }]);157 });...

Full Screen

Full Screen

browserElement_ExecuteScript.js

Source:browserElement_ExecuteScript.js Github

copy

Full Screen

...25 iframe.src = url;26 document.body.appendChild(iframe);27 });28 function onReady(iframe) {29 iframe.executeScript('4 + 4', {url}).then(rv => {30 is(rv, 8, `scriptId: ${scriptId++}`);31 return iframe.executeScript('(() => {return {a:42}})()', {url})32 }, bail).then(rv => {33 ok(c(rv, {a:42}), `scriptId: ${scriptId++}`);34 return iframe.executeScript('(() => {return {a:42}})()', {origin})35 }, bail).then(rv => {36 ok(c(rv, {a:42}), `scriptId: ${scriptId++}`);37 return iframe.executeScript('(() => {return {a:42}})()', {origin, url})38 }, bail).then(rv => {39 ok(c(rv, {a:42}), `scriptId: ${scriptId++}`);40 return iframe.executeScript(`41 new Promise((resolve, reject) => {42 resolve(document.body.textContent.trim());43 });44 `, {url})45 }, bail).then(rv => {46 is(rv, 'foo', `scriptId: ${scriptId++}`);47 return iframe.executeScript(`48 new Promise((resolve, reject) => {49 resolve({a:43,b:34});50 });51 `, {url})52 }, bail).then(rv => {53 ok(c(rv, {a:43,b:34}), `scriptId: ${scriptId++}`);54 return iframe.executeScript(`55 … syntax error56 `, {url});57 }, bail).then(bail, (error) => {58 is(error.name, 'SyntaxError: illegal character', `scriptId: ${scriptId++}`);59 return iframe.executeScript(`60 window61 `, {url});62 }).then(bail, (error) => {63 is(error.name, 'Script last expression must be a promise or a JSON object', `scriptId: ${scriptId++}`);64 return iframe.executeScript(`65 new Promise((resolve, reject) => {66 reject('BOOM');67 });68 `, {url});69 }).then(bail, (error) => {70 is(error.name, 'BOOM', `scriptId: ${scriptId++}`);71 return iframe.executeScript(`72 new Promise((resolve, reject) => {73 resolve(window);74 });75 `, {url});76 }).then(bail, (error) => {77 is(error.name, 'Value returned (resolve) by promise is not a valid JSON object', `scriptId: ${scriptId++}`);78 return iframe.executeScript('window.btoa("a")', {url})79 }, bail).then(rv => {80 ok(c(rv, 'YQ=='), `scriptId: ${scriptId++}`);81 return iframe.executeScript('window.wrappedJSObject.btoa("a")', {url})82 }, bail).then(bail, (error) => {83 is(error.name, 'TypeError: window.wrappedJSObject is undefined', `scriptId: ${scriptId++}`);84 return iframe.executeScript('42', {})85 }).then(bail, error => {86 is(error.name, 'InvalidAccessError', `scriptId: ${scriptId++}`);87 return iframe.executeScript('42');88 }).then(bail, error => {89 is(error.name, 'InvalidAccessError', `scriptId: ${scriptId++}`);90 return iframe.executeScript('43', { url: 'http://foo.com' });91 }).then(bail, (error) => {92 is(error.name, 'URL mismatches', `scriptId: ${scriptId++}`);93 return iframe.executeScript('43', { url: '_' });94 }, bail).then(bail, (error) => {95 is(error.name, 'Malformed URL', `scriptId: ${scriptId++}`);96 return iframe.executeScript('43', { origin: 'http://foo.com' });97 }, bail).then(bail, (error) => {98 is(error.name, 'Origin mismatches', `scriptId: ${scriptId++}`);99 return iframe.executeScript('43', { origin: 'https://example.org' });100 }, bail).then(bail, (error) => {101 is(error.name, 'Origin mismatches', `scriptId: ${scriptId++}`);102 SimpleTest.finish();103 });104 }105}...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1function test()2{3 build();4 driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');5 driver.findElement(webdriver.By.name('btnG')).click();6 driver.wait(function() {7 return driver.getTitle().then(function(title) {8 return title === 'webdriver - Google Search';9 });10 }, 1000);11 driver.executeScript("return wptdriver.executeScript('return 1+1');").then(function(result) {12 console.log(result);13 });14 driver.quit();15}16test();

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptdriver = require('wptdriver');2 console.log(result);3});4var wptdriver = require('wptdriver');5 console.log(result);6});7var wptdriver = require('wptdriver');8wptdriver.findElement("id", "lst-ib", function(err, result) {9 console.log(result);10});11var wptdriver = require('wptdriver');12wptdriver.findElements("id", "lst-ib", function(err, result) {13 console.log(result);14});15var wptdriver = require('wptdriver');16 console.log(result);17});18var wptdriver = require('wptdriver');19wptdriver.getCurrentUrl(function(err, result) {20 console.log(result);21});22var wptdriver = require('wptdriver');23wptdriver.getPageSource(function(err, result) {24 console.log(result);25});26var wptdriver = require('wptdriver');27wptdriver.getTitle(function(err, result) {28 console.log(result);29});30var wptdriver = require('wptdriver');31wptdriver.getWindowHandle(function(err, result) {32 console.log(result);33});34var wptdriver = require('wptdriver');35wptdriver.getWindowHandles(function(err, result) {36 console.log(result);37});38var wptdriver = require('wptdriver');39wptdriver.goBack(function(err, result) {40 console.log(result);41});42var wptdriver = require('wptdriver');

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptb = require('wptb');2wptb.executeScript('C:\\Users\\shubham\\Desktop\\test.js', 'C:\\Users\\shubham\\Desktop\\test.js', 'C:\\Users\\shubham\\Desktop\\test.js');3var wptb = require('wptb');4wptb.executeScript('C:\\Users\\shubham\\Desktop\\test.js', 'C:\\Users\\shubham\\Desktop\\test.js', 'C:\\Users\\shubham\\Desktop\\test.js');5var wptb = require('wptb');6wptb.executeScript('C:\\Users\\shubham\\Desktop\\test.js', 'C:\\Users\\shubham\\Desktop\\test.js', 'C:\\Users\\shubham\\Desktop\\test.js');7var wptb = require('wptb');8wptb.executeScript('C:\\Users\\shubham\\Desktop\\test.js', 'C:\\Users\\shubham\\Desktop\\test.js', 'C:\\Users\\shubham\\Desktop\\test.js');

Full Screen

Using AI Code Generation

copy

Full Screen

1wptb.executeScript(function(){2 wptb.browser.getTitle().then(function(title) {3 console.log('Title is: ' + title);4 });5});6### wptb.executeScript(callback)7### wptb.browser.getTitle()8### wptb.browser.findElement(locator)9### wptb.browser.findElements(locator)10### wptb.browser.getCurrentUrl()11### wptb.browser.getPageSource()12### wptb.browser.takeScreenshot()13### wptb.browser.wait(condition, timeout, message)14### wptb.browser.sleep(ms)15### wptb.browser.get(url)

Full Screen

Using AI Code Generation

copy

Full Screen

1function test(){2 let wptb = document.querySelector('wptb');3 wptb.executeScript('console.log("hello world")');4}5#### executeScript(script)6#### goBack()7#### goForward()8#### reload()9#### stop()10#### loadURL(url)11#### setZoom(zoomFactor)12#### getZoom()13#### openDevTools()14#### closeDevTools()15#### setDevToolsMode(mode)16#### setDevToolsPosition(position)17#### setDevToolsSize(size)18#### setDevToolsTheme(theme)19#### setDevToolsZoom(zoomFactor)20#### setDevToolsZoom(zoomFactor)

Full Screen

Using AI Code Generation

copy

Full Screen

1var driver = require('wptdriver');2var script = "return document.title;";3driver.executeScript(script, function(result) {4 console.log(result);5 driver.quit();6});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful